biococoa-2.2.2/000755 000765 000024 00000000000 11455661313 013742 5ustar00scottcstaff000000 000000 biococoa-2.2.2/Authors.txt000644 000765 000024 00000001533 11370700423 016122 0ustar00scottcstaff000000 000000 The BioCocoa Project ==================== Thanks and acknowledgements to the following contributors to BioCocoa, known as the BioCocoa team of the BioCocoa Project. All authors hold shared copyright ownership over the BioCocoa code and documentation. These authors have all agreed to provide their contributions to BioCocoa under a BSD style license provided in the license.txt file. The BioCocoa Team ================= Koen van der Drift Alexander Griekspoor Philipp Seibel John Timmer Peter Schols Erik Doernenburg Charles Parnot Scott Christley Portions of BioCocoa covered by other licenses ============================================== Hybrid suffix-array builder, written by Sean Quinlan and Sean Doward, distributed under the Lucent Public License Version 1.02. Copyright (C) 2003, Lucent Technologies Inc. and others. All Rights Reserved. biococoa-2.2.2/BCAppKit/000755 000765 000024 00000000000 11455661313 015337 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/000755 000765 000024 00000000000 11455661314 016256 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BioCocoa.xcodeproj/000755 000765 000024 00000000000 11455661313 017414 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BioCocoa_Prefix.h000755 000765 000024 00000003214 11223237412 017101 0ustar00scottcstaff000000 000000 // // Prefix header for all source files of the 'BioCocoa' target in the 'BioCocoa' project. // // // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifdef __OBJC__ #import #import #endif biococoa-2.2.2/ChangeLog000644 000765 000024 00000002265 11455660036 015522 0ustar00scottcstaff000000 000000 2010-10-14 Scott Christley * Readme.txt: Add information about 2.2.2 version. * Version: Bump to 2.2.2 * BCUtilStrings.m: Remove 64-bit hack for older GNUstep. * BCDataMatrix.m: Likewise. * BCSequenceReader.m: Likewise. * BCMCP.m: Initialize variables. 2010-05-06 Scott Christley * Readme.txt: Add information about 2.2.1 version. * Version: Bump to 2.2.1 * BCSuffixArray.[hm]: Update license to Lucent Public License Version 1.02 for the suffix array code. * Authors.txt: Likewise. * license.txt: Add Lucent license. * BCFoundation/GNUmakefile: Don't install BCInternal.h * BCDataMatrix.h: Eliminate FOUNDATION_EXPORT. * BCStringDefinitions.h: Likewise. * BCAnnotation.h: Likewise. * BCInternal.h: Likewise. 2010-01-14 Scott Christley * BCDataMatrix.[hm], BCAnnotation.[hm]: Move BCInternal.h from interface to implementation file. * BCNucleotideRNA.m (+initBases): Use non-deprecated method. 2009-09-20 Scott Christley * Readme.txt: Add information about 2.2.0 version. * Version: Bump to 2.2.0 * ChangeLog: New file. * BCFoundation/BCGeneExpression/GNUmakefile: New file. biococoa-2.2.2/DeveloperDocs/000755 000765 000024 00000000000 11455661313 016500 5ustar00scottcstaff000000 000000 biococoa-2.2.2/Documentation/000755 000765 000024 00000000000 11455661313 016553 5ustar00scottcstaff000000 000000 biococoa-2.2.2/GNUmakefile000644 000765 000024 00000004050 11226023231 015776 0ustar00scottcstaff000000 000000 # # GNUmakefile # # Written by: Scott Christley # Copyright (c) 2003-2009 The BioCocoa Project. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This usually happens when you forget to source GNUstep.sh ifeq ($(GNUSTEP_MAKEFILES),) $(error You need to run the GNUstep configuration script before compiling!) endif include $(GNUSTEP_MAKEFILES)/common.make include ./Version FRAMEWORK_NAME = BioCocoa BioCocoa_SUBPROJECTS = \ BCFoundation BioCocoa_RESOURCE_FILES = \ BCFoundation/BCSymbol/SymbolTemplates/nucleotides.plist \ BCFoundation/BCSymbol/SymbolTemplates/aminoacids.plist -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/framework.make -include GNUmakefile.postamble biococoa-2.2.2/license.txt000644 000765 000024 00000032223 11370700423 016117 0ustar00scottcstaff000000 000000 The BioCocoa Project BioCocoa license ==================== Copyright (c) 2003-2009 The BioCocoa Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Portions of BioCocoa covered by other licenses ============================================== THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 1. DEFINITIONS "Contribution" means: 1. in the case of Lucent Technologies Inc. ("LUCENT"), the Original Program, and 2. in the case of each Contributor, 1. changes to the Program, and 2. additions to the Program; where such changes and/or additions to the Program were added to the Program by such Contributor itself or anyone acting on such Contributor's behalf, and the Contributor explicitly consents, in accordance with Section 3C, to characterization of the changes and/or additions as Contributions. "Contributor" means LUCENT and any other entity that has Contributed a Contribution to the Program. "Distributor" means a Recipient that distributes the Program, modifications to the Program, or any part thereof. "Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. "Original Program" means the original version of the software accompanying this Agreement as released by LUCENT, including source code, object code and documentation, if any. "Program" means the Original Program and Contributions or any part thereof "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. 2. GRANT OF RIGHTS a. Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. b. Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. The patent license granted by a Contributor shall also apply to the combination of the Contribution of that Contributor and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license granted by a Contributor shall not apply to (i) any other combinations which include the Contribution, nor to (ii) Contributions of other Contributors. No hardware per se is licensed hereunder. c. Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. d. Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. 3. REQUIREMENTS A. Distributor may choose to distribute the Program in any form under this Agreement or under its own license agreement, provided that: 1. it complies with the terms and conditions of this Agreement; 2. if the Program is distributed in source code or other tangible form, a copy of this Agreement or Distributor's own license agreement is included with each copy of the Program; and 3. if distributed under Distributor's own license agreement, such license agreement: 1. effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; 2. effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; and 3. states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party. B. Each Distributor must include the following in a conspicuous location in the Program: Copyright (C) 2003, Lucent Technologies Inc. and others. All Rights Reserved. C. In addition, each Contributor must identify itself as the originator of its Contribution in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. Also, each Contributor must agree that the additions and/or changes are intended to be a Contribution. Once a Contribution is contributed, it may not thereafter be revoked. 4. COMMERCIAL DISTRIBUTION Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Distributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for Contributors. Therefore, if a Distributor includes the Program in a commercial product offering, such Distributor ("Commercial Distributor") hereby agrees to defend and indemnify every Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Distributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Distributor in writing of such claim, and b) allow the Commercial Distributor to control, and cooperate with the Commercial Distributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. For example, a Distributor might include the Program in a commercial product offering, Product X. That Distributor is then a Commercial Distributor. If that Commercial Distributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Distributor's responsibility alone. Under this section, the Commercial Distributor would have to defend claims against the Contributors related to those performance claims and warranties, and if a court requires any Contributor to pay any damages as a result, the Commercial Distributor must pay those damages. 5. NO WARRANTY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. 6. DISCLAIMER OF LIABILITY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 7. EXPORT CONTROL Recipient agrees that Recipient alone is responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries). 8. GENERAL If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. LUCENT may publish new versions (including revisions) of this Agreement from time to time. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. No one other than LUCENT has the right to modify this Agreement. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. biococoa-2.2.2/main.c000755 000765 000024 00000000216 10404057133 015024 0ustar00scottcstaff000000 000000 /* This is the default source file for new frameworks. */ /* You can either fill in code here or remove this and create or add new files. */ biococoa-2.2.2/Publications.txt000644 000765 000024 00000000746 11014566535 017147 0ustar00scottcstaff000000 000000 Publications ------------ This file contains the list of publications that have been published about BioCocoa or reference BioCocoa. Scott Christley, Neil F. Lobo and Greg Madey. Multiple Organism Algorithm for Finding Ultraconserved Elements. BMC Bioinformatics, 9: 15, 2008. ----- This paper describes the algorithms implemented in BCSuffixArray and BCMCP classes. Also, the programs mentioned in the paper can be found in the Ultraconserved project in the BioCocoa Applications. biococoa-2.2.2/Readme.txt000755 000765 000024 00000012161 11455660036 015705 0ustar00scottcstaff000000 000000 BioCocoa ======== BioCocoa is an open source Cocoa/OpenStep framework for bioinformatics written in Objective-C. Project homepage: http://www.bioinformatics.org/BioCocoa Installation on Mac OSX ======================= Copy BioCocoa.framework to /Library/Frameworks Installation on GNU/Linux with GNUstep ====================================== Make sure the GNUstep environment is setup properly. make make install If you are running a GNU/Linux system that provides a package repository (e.g. Debian) then search for BioCocoa among the packages. We are working to make such packages available. Release history =============== BioCocoa 2.2.2 - Removed 64-bit hacks for older GNUstep. BioCocoa 2.2.1 - Update license for suffix array code to Lucent Public License Version 1.02, look at license.txt file. - Minor bug fixes. BioCocoa 2.2.0 - Change license to BSD style license, look at license.txt file. - New BCDataMatrix class for managing 2-dimensional data matrices. - New BCGeneExpression classes for managing gene expression data including parsing SOFT format. - New BCPreference class for global settings, currently being used for a shared data directory to hold genome sequences, gene expression data, etc. BioCocoa 2.1.1 - Bug fix release for GNUstep, set proper version for framework. BioCocoa 2.1.0 -- (found in Tags / 2.1.0) - New BCSuffixArray and BCMCP classes for constructing disk-based suffix arrays of sequences and finding the maximum common prefixes of sequences using those suffix arrays. This is work based upon the following publication: Scott Christley, Neil F. Lobo and Greg Madey. Multiple Organism Algorithm for Finding Ultraconserved Elements. BMC Bioinformatics, 9: 15, 2008. - New BCCachedSequenceFile and BCCachedFastaFile classes that allow for reading sequence data without reading the whole sequence into memory. This is useful for working with very large sequences like whole genomes. A future release will support a BCCachedSequence which provides a consistent sequence interface regardless of whether the sequence is in memory or cached on disk. - File format can be explictly provided to BCSequenceReader using BCFileFormat. - Documentation updates. - More complete port to GNUstep, all BCFoundation functionality should be available. - Quad-fat binary supporting 32/64-bit and ppc/intel processors. BioCocoa 2.0 -- (found in Tags / 2.0) The first release of the new BioCocoa project - New BCSequence and BCSymbol based data structure - BCSequenceReader is supported for reading of sequence files (writing files will be implemented in later release). - Two new example projects: Translation and Peptides (SequenceConverter will be back in later release). - Headerdoc based source code documentation - Switched to svn for versioncontrol - Swicthed to Creative Commons license BioCocoa 1.7 -- (found in Tags / 1.7) This new update of the classic BioCocoa code contains the following new features: - BCReader, the standalone BCReader classes for sequence file IO (original version Peter Schols) - EntrezController, a controller plus view for browsing and fetching NCBI's Entrez Database - BCSequenceView+, a custom NSTextView for displaying biological sequences (original version Koen van der Drift) BioCocoa 1.6 -- (found in Tags / 1.6) This folder contains: - the ProjectBuilder project of the SequenceConverter utility application (BioCocoa util.pbproj), which can be opened in ProjectBuilder on Mac OS X or in the GNUstep ProjectCenter on Linux/Windows (see www.gnustep.org) - the compiled utility application SequenceConverter, ready to run on Mac OS X 10.2 or higher - the ProjectBuilder project of the BioCocoa framework (BioCocoa Framework), which can be opened in ProjectBuilder on Mac OS X or in the GNUstep ProjectCenter on Linux/Windows (see www.gnustep.org) - the compiled BioCocoa framework (BioCocoa.framework), which can be opened in ProjectBuilder on Mac OS X or in the GNUstep ProjectCenter on Linux/Windows (see www.gnustep.org) - the GNU GPL If you are not a developer and you are only interested in the SequenceConverter utility application (to convert between sequence file formats), you can remove everything in this package except for the SequenceConverter application itself. Changes since version 1.2: - BC now reads SwissProt, NCBI, and PDB files - To be consistent when reading all filetypes, 'taxon' and 'taxa' were changed to 'item' and 'items' respectively in BCReader. BCCreator still uses 'taxon' and 'taxa'. - Added a 'fileType' key-value Changes since version 1.1: - BC now reads and writes the GCG-MSF format - Added Unix and Windows line break methods for cross-platform compatibility - BC now recognizes the Trees Nexus block and stores all Newick strings in the root dictionary - BC returns all Nexus blocks in the root dictionary - BC now stores the line break of the original source file in the root dictionary For more information on how to use BioCocoa in your own app, see the API docs at: http://www.bioinformatics.org/BioCocoa/docs and the header files in the framework. Project homepage: http://www.bioinformatics.org/BioCocoa biococoa-2.2.2/Resources/000755 000765 000024 00000000000 11455661313 015714 5ustar00scottcstaff000000 000000 biococoa-2.2.2/Tests/000755 000765 000024 00000000000 11455661313 015044 5ustar00scottcstaff000000 000000 biococoa-2.2.2/Version000644 000765 000024 00000000511 11455660036 015310 0ustar00scottcstaff000000 000000 # This file is included in various Makefiles to get version information. # Copyright (C) 2008-2009 The BioCocoa Project # The version number of this release. MAJOR_VERSION=2 MINOR_VERSION=2 SUBMINOR_VERSION=2 BioCocoa_CURRENT_VERSION_NAME=$(MAJOR_VERSION) BioCocoa_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION) biococoa-2.2.2/Tests/Test-BCFoundation/000755 000765 000024 00000000000 11455661313 020274 5ustar00scottcstaff000000 000000 biococoa-2.2.2/Tests/Test-BCFoundation/DataFiles/000755 000765 000024 00000000000 11455661313 022130 5ustar00scottcstaff000000 000000 biococoa-2.2.2/Tests/Test-BCFoundation/Test-BCFoundation-Info.plist000644 000765 000024 00000001372 10404057133 025465 0ustar00scottcstaff000000 000000 CFBundleDevelopmentRegion English CFBundleExecutable Test - BCFoundation CFBundleGetInfoString CFBundleIdentifier org.bioinformatics.biococoa.Test_BCFoundation CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleShortVersionString CFBundleSignature ???? CFBundleVersion 1.0.0d1 biococoa-2.2.2/Tests/Test-BCFoundation/Test-BCFoundation_Prefix.h000755 000765 000024 00000003342 11223237412 025207 0ustar00scottcstaff000000 000000 // // Prefix header for all source files of the 'BCFoundation-tests' target // in the 'BioCocoa' project. // // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifdef __OBJC__ #import #import #import #import #endif biococoa-2.2.2/Tests/Test-BCFoundation/TestBCCachedSequenceFile.h000644 000765 000024 00000003222 11223237412 025141 0ustar00scottcstaff000000 000000 // // TestBCCachedSequenceFile.h // BioCocoa // // Created by Scott Christley on 9/25/07. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import @interface TestBCCachedSequenceFile : SenTestCase { } @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCCachedSequenceFile.m000644 000765 000024 00000010115 11223237412 025145 0ustar00scottcstaff000000 000000 // // TestBCCachedSequenceFile.m // BioCocoa // // Created by Scott Christley on 9/25/07. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "TestBCCachedSequenceFile.h" @implementation TestBCCachedSequenceFile // read fasta format, DNA - (void)testReadDNAFastaFile { NSLog(@"-testReadDNAFastaFile"); NSBundle *aBundle = [NSBundle bundleForClass: [self class]]; NSString *fileName = [aBundle pathForResource: @"test" ofType: @"fa"]; // read as cache and read in memory, then compare BCCachedSequenceFile *cacheFile = [BCCachedSequenceFile readCachedFileUsingPath: fileName]; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; BCSequenceArray *sequenceArray = [sequenceReader readFileUsingPath: fileName format: BCFastaFileFormat]; // errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (cacheFile == nil) [error appendString: @"cache file is nil\n"]; else { if (sequenceArray == nil) [error appendString: @"Sequence array is nil\n"]; else { if ([sequenceArray count] != 2) [error appendFormat: @"Number of sequence in array is incorrect, 2 != %d\n", [sequenceArray count]]; else { BCSequence *aSeq = [sequenceArray sequenceAtIndex: 0]; BCSequence *revSeq = [aSeq reverseComplement]; const unsigned char *seqData1 = [aSeq bytes]; int aLen = [aSeq length]; char seqData2[aLen]; if (aLen != 517) [error appendFormat: @"Length of sequence is incorrect, 517 != %d\n", aLen]; // forward strand int result = [cacheFile symbols: seqData2 atPosition: 0 ofLength: aLen forSequenceNumber: 0]; if (result != aLen) [error appendFormat: @"Could not read full length of sequence, %d != %d\n", aLen, result]; int i; for (i = 0; i < result; ++i) { if (seqData1[i] != seqData2[i]) { [error appendFormat: @"Sequence data does not match at position %d, %c != %c\n", i, seqData1[i], seqData2[i]]; break; } } #if 0 // reverse complement in BCSequence not working right NSLog(@"%@\n", [revSeq sequenceString]); // reverse strand seqData1 = [revSeq bytes]; result = [cacheFile symbols: seqData2 atPosition: aLen ofLength: aLen forSequenceNumber: 0]; for (i = 0; i < result; ++i) { if (seqData1[i] != seqData2[i]) { [error appendFormat: @"Sequence data does not match at position %d, %c != %c\n", i, seqData1[i], seqData2[i]]; break; } } #endif } } } // if error!=@"", the test failed STAssertTrue ([error isEqualToString:@""], error); } @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCSequenceDNAInit.h000644 000765 000024 00000000350 10404057133 024417 0ustar00scottcstaff000000 000000 // // TestBCSequenceDNAInit.h // BioCocoa-test // /* Tests for the initializers of BCSequenceDNA. See implementation file */ #import @interface TestBCSequenceDNAInit : SenTestCase { } @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCSequenceDNAInit.m000644 000765 000024 00000027323 10404057133 024435 0ustar00scottcstaff000000 000000 // // TestBCSequenceDNAInit.m // BioCocoa-test // #import "TestBCSequenceDNAInit.h" @implementation TestBCSequenceDNAInit //initializer with string //using default symbol set //all known symbols - (void)testInitStringKnownSymbols { NSString *initial,*expected,*obtained; BCSequenceDNA *sequence; initial= @"ATGTTGGAGGATGGGTTACGACGTRYMKSWHBVDNAGCGT"; expected=@"ATGTTGGAGGATGGGTTACGACGTRYMKSWHBVDNAGCGT"; sequence=[BCSequenceDNA sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCDNASequence) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //some unknown symbols - (void)testInitStringUnknownSymbols { NSString *initial,*expected,*obtained; BCSequenceDNA *sequence; initial= @"ATG(87)TTGGAGGATGGGTTAACGTRYMK[128~]SWHBVDNCNGAGHBCG123T"; expected=@"ATGTTGGAGGATGGGTTAACGTRYMKSWHBVDNCNGAGHBCGT"; sequence=[BCSequenceDNA sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCDNASequence) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //empty string - (void)testInitStringEmptyString { NSString *initial,*expected,*obtained; BCSequenceDNA *sequence; initial= @""; expected=@""; sequence=[BCSequenceDNA sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCDNASequence) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //string composed only of unknown symbols - (void)testInitStringAllUnknown { NSString *initial,*expected,*obtained; BCSequenceDNA *sequence; initial= @"123458()%$#@!#"; expected=@""; sequence=[BCSequenceDNA sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCDNASequence) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using strict symbol set //all known symbols - (void)testInitStringStrictSymbolSetKnownSymbols { NSString *initial,*expected,*obtained; BCSequenceDNA *sequence; initial= @"ATGTTGGAGGATGGGTTACGAGCGT"; expected=@"ATGTTGGAGGATGGGTTACGAGCGT"; sequence=[BCSequenceDNA sequenceWithString:initial symbolSet:[BCSymbolSet dnaStrictSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCDNASequence) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaStrictSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaStrictSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using strict symbol set //some unknown symbols - (void)testInitStringStrictSymbolSetUnknownSymbols { NSString *initial,*expected,*obtained; BCSequenceDNA *sequence; initial= @"ATG(87)TTGGAGGACGTRYMKSWHBVDNATGGGTTACNGAGHBCG123T"; expected=@"ATGTTGGAGGACGTATGGGTTACGAGCGT"; sequence=[BCSequenceDNA sequenceWithString:initial symbolSet:[BCSymbolSet dnaStrictSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCDNASequence) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaStrictSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaStrictSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using symbol set of the wrong type --> default symbol set //some unknown symbols - (void)testInitStringWrongSymbolSet { NSString *initial,*expected,*obtained; BCSequenceDNA *sequence; initial= @"ATG(87)TTGGAGGATGGGTTAACGTRYMK[128~]SWHBVDNCNGAGHBCG123T"; expected=@"ATGTTGGAGGATGGGTTAACGTRYMKSWHBVDNCNGAGHBCGT"; sequence=[BCSequenceDNA sequenceWithString:initial symbolSet:[BCSymbolSet rnaSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCDNASequence) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using custom symbol set - (void)testInitStringCustomSymbolSet { NSString *initial,*expected,*obtained; BCSequenceDNA *sequence; BCSymbolSet *set; initial= @"ATG(87)TTGGAGGACGTRYMKSWHBVDNATGGGTTACNGAGHBCG123T"; expected=@"AAAAAA"; set=[BCSymbolSet symbolSetWithString:@"A" sequenceType:BCDNASequence]; sequence=[BCSequenceDNA sequenceWithString:initial symbolSet:set]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCDNASequence) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=set) [error appendFormat:@"Symbol set should be %@ but is %@\n", set,[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using empty symbol set - (void)testInitStringEmptySymbolSet { NSString *initial,*expected,*obtained; BCSequenceDNA *sequence; BCSymbolSet *set; initial= @"ATG(87)TTGGAGGACGTRYMKSWHBVDNATGGGTTACNGAGHBCG123T"; expected=@""; set=[BCSymbolSet symbolSetWithString:@"" sequenceType:BCDNASequence]; sequence=[BCSequenceDNA sequenceWithString:initial symbolSet:set]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCDNASequence) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=set) [error appendFormat:@"Symbol set should be %@ but is %@\n", set,[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCSequenceInit.h000644 000765 000024 00000004073 11223237412 024102 0ustar00scottcstaff000000 000000 // // TestBCSequenceInit.h // BioCocoa-test // // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* Test inititializers for class BCSequence See implementation file Various initial sequence strings, sequence type and symbol sets are used, and the created instance is checked for: * sequenceString * sequenceType */ #import @class BCSequence; BCSequenceType SequenceTypeFromString (NSString *aString); @interface TestBCSequenceInit : SenTestCase { //NSArray *sequences; } /* //init and dealloc ivar 'sequence' - (void) setUp; - (void) tearDown; //the tests - (void)testSequenceStrings; - (void)testSequenceTypes; */ @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCSequenceInit.m000644 000765 000024 00000136572 11223237412 024121 0ustar00scottcstaff000000 000000 // // TestBCSequenceInit.m // BioCocoa-test // // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* NEEDS TO BE UPDATED - TEMPORARILY REMOVED FROM Test - BCFoundation TARGET */ #import "TestBCSequenceInit.h" /* BCSequenceType SequenceTypeFromString (NSString *aString) { if ([aString isEqualToString:@"BCSequenceTypeDNA"]) return BCSequenceTypeDNA; else if ([aString isEqualToString:@"BCSequenceTypeRNA"]) return BCSequenceTypeRNA; else if ([aString isEqualToString:@"BCSequenceTypeProtein"]) return BCSequenceTypeProtein; else if ([aString isEqualToString:@"BCSequenceTypeCodon"]) return BCSequenceTypeCodon; else return BCSequenceTypeOther; } */ /* Symbol sets: DNA ABCD--GH--K-MN---RST-VW-Y- DNA strict A-C---G------------T------ RNA ABCD--GH--K-MN---RS-UVW-Y- RNA strict A-C---G-------------U----- protein ABCDEFGHI-KLMN-PQRST-VW-YZ protein strict A-CDEFGHI-KLMN-PQRST-VW-Y- */ @implementation TestBCSequenceInit #pragma mark *** Initializers can recognize sequence type ? *** //initializer with string that should give DNA //all known DNA symbols - (void)testInitStringKnownDNASymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ATGTTGGAGGATGGGTTACGACGTRYMKSWHBVDNAGCGT"; expected=@"ATGTTGGAGGATGGGTTACGACGTRYMKSWHBVDNAGCGT"; sequence=[BCSequence sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeDNA) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string that should give DNA //all known DNA symbols except for some Us - (void)testInitStringMostlyDNASymbols1 { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ATGTUTGGAGGATUUGGGTTACGACGUTRYMKSWHBVDNAGCGT"; expected=@"ATGTTGGAGGATGGGTTACGACGTRYMKSWHBVDNAGCGT"; sequence=[BCSequence sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeDNA) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string that should give DNA //all known DNA symbols except for some Us and unknown symbols - (void)testInitStringMostlyDNASymbols2 { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ATGTUTGGAGGATUUGGGTTACGACGUTRYMK(123)SWHBVDNAGCGT++988{}?[]"; expected=@"ATGTTGGAGGATGGGTTACGACGTRYMKSWHBVDNAGCGT"; sequence=[BCSequence sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeDNA) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string that should give RNA //all known RNA symbols - (void)testInitStringKnownRNASymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"AUGUUGGAGGAUGGGUUACGACGURYMKSWHBVDNAGCGU"; expected=@"AUGUUGGAGGAUGGGUUACGACGURYMKSWHBVDNAGCGU"; sequence=[BCSequence sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeRNA) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string that should give RNA //all known RNA symbols except for some Ts - (void)testInitStringMostlyRNASymbols1 { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"AUGUUTGGAGGAUTTGGGUUACGACGUTRYMKSWHBVDNAGCGU"; expected=@"AUGUUGGAGGAUGGGUUACGACGURYMKSWHBVDNAGCGU"; sequence=[BCSequence sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeRNA) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string that should give RNA //all known RNA symbols except for some Ts and unknown symbols - (void)testInitStringMostlyRNASymbols2 { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"AUGUUTGGAGGAUT1234567890()[]TGG{-+\\}GUUACGACGUTRYMKSWHBVD%%NAGCGU"; expected=@"AUGUUGGAGGAUGGGUUACGACGURYMKSWHBVDNAGCGU"; sequence=[BCSequence sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeRNA) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string that should give RNA //all known prot symbols except for nine U, //which should give RNA the edge // RNA ABCD--GH--K-MN---RS-UVW-Y- // protein ABCDEFGHI-KLMN-PQRST-VW-YZ - (void)testInitStringMostlyRNASymbols3 { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ABCDEFGHIKLMNPQRSTVWYZUUUUUUUUU"; expected=@"ABCDGHKMNRSVWYUUUUUUUUU"; sequence=[BCSequence sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeRNA) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string that should give protein //all known prot symbols - (void)testInitStringKnownProteinSymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ACDEFGHIKLMNPQRSTVWYBZ"; expected=@"ACDEFGHIKLMNPQRSTVWYBZ"; sequence=[BCSequence sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeProtein) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string that should give protein //all known prot symbols except for one U - (void)testInitStringMostlyProteinSymbols1 { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ACDEFGHIKLMNPQRSTVWYBZU"; expected=@"ACDEFGHIKLMNPQRSTVWYBZ"; sequence=[BCSequence sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeProtein) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string that should give protein //all known prot symbols except for seven U //which should give protein the edge // RNA ABCD--GH--K-MN---RS-UVW-Y- // protein ABCDEFGHI-KLMN-PQRST-VW-YZ - (void)testInitStringMostlyProteinSymbols2 { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ACDEFGHIKLMNPQRSTVWYBZUUUUUUU"; expected=@"ACDEFGHIKLMNPQRSTVWYBZ"; sequence=[BCSequence sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeProtein) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } @end /* These tests are the same as TestBCSequenceDNAInit, except for test 'testInitStringWrongSymbolSet' that was removed */ @implementation TestBCSequenceInit (TestBCSequenceInitDNACategory) //initializer with string //using default symbol set //all known symbols - (void)testInitStringKnownSymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ATGTTGGAGGATGGGTTACGACGTRYMKSWHBVDNAGCGT"; expected=@"ATGTTGGAGGATGGGTTACGACGTRYMKSWHBVDNAGCGT"; sequence=[BCSequence sequenceWithString:initial symbolSet: [BCSymbolSet dnaSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeDNA) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //some unknown symbols - (void)testInitStringUnknownSymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ATG(87)TTGGAGGATGGGTTAACGTRYMK[128~]SWHBVDNCNGAGHBCG123T"; expected=@"ATGTTGGAGGATGGGTTAACGTRYMKSWHBVDNCNGAGHBCGT"; sequence=[BCSequence sequenceWithString:initial symbolSet: [BCSymbolSet dnaSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeDNA) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //empty string - (void)testInitStringEmptyString { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @""; expected=@""; sequence=[BCSequence sequenceWithString:initial symbolSet: [BCSymbolSet dnaSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeDNA) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //string composed only of unknown symbols - (void)testInitStringAllUnknown { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"123458()%$#@!#"; expected=@""; sequence=[BCSequence sequenceWithString:initial symbolSet: [BCSymbolSet dnaSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeDNA) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using strict symbol set //all known symbols - (void)testInitStringStrictSymbolSetKnownSymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ATGTTGGAGGATGGGTTACGAGCGT"; expected=@"ATGTTGGAGGATGGGTTACGAGCGT"; sequence=[BCSequence sequenceWithString:initial symbolSet:[BCSymbolSet dnaStrictSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeDNA) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaStrictSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaStrictSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using strict symbol set //some unknown symbols - (void)testInitStringStrictSymbolSetUnknownSymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ATG(87)TTGGAGGACGTRYMKSWHBVDNATGGGTTACNGAGHBCG123T"; expected=@"ATGTTGGAGGACGTATGGGTTACGAGCGT"; sequence=[BCSequence sequenceWithString:initial symbolSet:[BCSymbolSet dnaStrictSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeDNA) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet dnaStrictSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet dnaStrictSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using custom symbol set - (void)testInitStringCustomSymbolSet { NSString *initial,*expected,*obtained; BCSequence *sequence; BCSymbolSet *set; initial= @"ATG(87)TTGGAGGACGTRYMKSWHBVDNATGGGTTACNGAGHBCG123T"; expected=@"AAAAAA"; set=[BCSymbolSet symbolSetWithString:@"A" sequenceType:BCSequenceTypeDNA]; sequence=[BCSequence sequenceWithString:initial symbolSet:set]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeDNA) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=set) [error appendFormat:@"Symbol set should be %@ but is %@\n", set,[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using empty symbol set - (void)testInitStringEmptySymbolSet { NSString *initial,*expected,*obtained; BCSequence *sequence; BCSymbolSet *set; initial= @"ATG(87)TTGGAGGACGTRYMKSWHBVDNATGGGTTACNGAGHBCG123T"; expected=@""; set=[BCSymbolSet symbolSetWithString:@"" sequenceType:BCSequenceTypeDNA]; sequence=[BCSequence sequenceWithString:initial symbolSet:set]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeDNA) [error appendFormat:@"Sequence should be DNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=set) [error appendFormat:@"Symbol set should be %@ but is %@\n", set,[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } @end /* These tests are the same as TestBCSequenceRNAInit except: testInitStringWrongSymbolSet testInitStringKnownSymbolsConvertingThymidinesYes testInitStringKnownSymbolsConvertingThymidinesNo testInitStringKnownSymbolsConvertingThymidinesYesMixUT */ @implementation TestBCSequenceInit (TestBCSequenceInitRNACategory) //initializer with string //using default symbol set //all known symbols - (void)testInitStringKnownSymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"AUGUUGGAGGAUGGGUUACGACGURYMKSWHBVDNAGCGU"; expected=@"AUGUUGGAGGAUGGGUUACGACGURYMKSWHBVDNAGCGU"; sequence=[BCSequence sequenceWithString:initial symbolSet: [BCSymbolSet rnaSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeRNA) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //some unknown symbols - (void)testInitStringUnknownSymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"AUG(87)UUGGAGGAUGGGUUACGACGURYMK[128~]SWHBVDNAGCGU"; expected=@"AUGUUGGAGGAUGGGUUACGACGURYMKSWHBVDNAGCGU"; sequence=[BCSequence sequenceWithString:initial symbolSet: [BCSymbolSet rnaSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeRNA) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //empty string - (void)testInitStringEmptyString { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @""; expected=@""; sequence=[BCSequence sequenceWithString:initial symbolSet: [BCSymbolSet rnaSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeRNA) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //string composed only of unknown symbols - (void)testInitStringAllUnknown { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"123458()%$#@!#"; expected=@""; sequence=[BCSequence sequenceWithString:initial symbolSet: [BCSymbolSet rnaSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeRNA) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using strict symbol set //all known symbols - (void)testInitStringStrictSymbolSetKnownSymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"AUGUUGGAGGAUGGGUUACGAGCGU"; expected=@"AUGUUGGAGGAUGGGUUACGAGCGU"; sequence=[BCSequence sequenceWithString:initial symbolSet:[BCSymbolSet rnaStrictSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeRNA) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaStrictSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaStrictSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using strict symbol set //some unknown symbols - (void)testInitStringStrictSymbolSetUnknownSymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"AUG(87)UUGGAGGACGURYMKSWHBVDNAUGGGUUACNGAGHBCG123U"; expected=@"AUGUUGGAGGACGUAUGGGUUACGAGCGU"; sequence=[BCSequence sequenceWithString:initial symbolSet:[BCSymbolSet rnaStrictSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeRNA) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaStrictSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaStrictSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using custom symbol set - (void)testInitStringCustomSymbolSet { NSString *initial,*expected,*obtained; BCSequence *sequence; BCSymbolSet *set; initial= @"AUG(87)UUGGAGGACGURYMKSWHBVDNAUGGGUUACNGAGHBCG123U"; expected=@"AAAAAA"; set=[BCSymbolSet symbolSetWithString:@"A" sequenceType:BCSequenceTypeRNA]; sequence=[BCSequence sequenceWithString:initial symbolSet:set]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeRNA) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=set) [error appendFormat:@"Symbol set should be %@ but is %@\n", set,[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using empty symbol set - (void)testInitStringEmptySymbolSet { NSString *initial,*expected,*obtained; BCSequence *sequence; BCSymbolSet *set; initial= @"AUG(87)UUGGAGGACGURYMKSWHBVDNAUGGGUUACNGAGHBCG123U"; expected=@""; set=[BCSymbolSet symbolSetWithString:@"" sequenceType:BCSequenceTypeRNA]; sequence=[BCSequence sequenceWithString:initial symbolSet:set]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeRNA) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=set) [error appendFormat:@"Symbol set should be %@ but is %@\n", set,[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } @end /* These tests are the same as TestBCSequenceProteinInit except: testInitStringWrongSymbolSet */ @implementation TestBCSequenceInit (TestBCSequenceInitProteinCategory) //initializer with string //using default symbol set //all known symbols - (void)testInitStringKnownSymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ACDEFGHIKLMNPQRSTVWYBZ"; expected=@"ACDEFGHIKLMNPQRSTVWYBZ"; sequence=[BCSequence sequenceWithString:initial symbolSet: [BCSymbolSet proteinSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeProtein) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //some unknown symbols - (void)testInitStringUnknownSymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ABCDEFGHIJKLMNOPQRSTUVWXYZ(123)ACDEFGHIKL[87~!]MNPQRSTVWYBZ"; expected=@"ABCDEFGHIKLMNPQRSTVWYZACDEFGHIKLMNPQRSTVWYBZ"; sequence=[BCSequence sequenceWithString:initial symbolSet: [BCSymbolSet proteinSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeProtein) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //empty string - (void)testInitStringEmptyString { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @""; expected=@""; sequence=[BCSequence sequenceWithString:initial symbolSet: [BCSymbolSet proteinSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeProtein) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //string composed only of unknown symbols - (void)testInitStringAllUnknown { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"JOUX123458()%$#@!#"; expected=@""; sequence=[BCSequence sequenceWithString:initial symbolSet: [BCSymbolSet proteinSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeProtein) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using strict symbol set //all known symbols - (void)testInitStringStrictSymbolSetKnownSymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ACDEFGHIKLMNPQRSTVWY"; expected=@"ACDEFGHIKLMNPQRSTVWY"; sequence=[BCSequence sequenceWithString:initial symbolSet:[BCSymbolSet proteinStrictSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeProtein) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinStrictSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinStrictSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using strict symbol set //some unknown symbols - (void)testInitStringStrictSymbolSetUnknownSymbols { NSString *initial,*expected,*obtained; BCSequence *sequence; initial= @"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; expected=@"ACDEFGHIKLMNPQRSTVWY"; sequence=[BCSequence sequenceWithString:initial symbolSet:[BCSymbolSet proteinStrictSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeProtein) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinStrictSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinStrictSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using custom symbol set - (void)testInitStringCustomSymbolSet { NSString *initial,*expected,*obtained; BCSequence *sequence; BCSymbolSet *set; initial= @"ATGJOUX(87)TTGGAGGACGTRYMKSWHBVDNATGGGTTACNGAGHBCG123T"; expected=@"AAAAAA"; set=[BCSymbolSet symbolSetWithString:@"A" sequenceType:BCSequenceTypeProtein]; sequence=[BCSequence sequenceWithString:initial symbolSet:set]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeProtein) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=set) [error appendFormat:@"Symbol set should be %@ but is %@\n", set,[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using empty symbol set - (void)testInitStringEmptySymbolSet { NSString *initial,*expected,*obtained; BCSequence *sequence; BCSymbolSet *set; initial= @"ATGJOUX(87)TTGGAGGACGTRYMKSWHBVDNATGGGTTACNGAGHBCG123T"; expected=@""; set=[BCSymbolSet symbolSetWithString:@"" sequenceType:BCSequenceTypeProtein]; sequence=[BCSequence sequenceWithString:initial symbolSet:set]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCSequenceTypeProtein) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=set) [error appendFormat:@"Symbol set should be %@ but is %@\n", set,[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCSequenceProperties.h000644 000765 000024 00000003216 11223237412 025331 0ustar00scottcstaff000000 000000 // // TestBCSequenceProperties.h // BioCocoa // // Created by Koen van der Drift on 4/5/05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import @interface TestBCSequenceProperties : SenTestCase { } @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCSequenceProperties.m000644 000765 000024 00000005217 11223237412 025341 0ustar00scottcstaff000000 000000 // // TestBCSequenceProperties.m // BioCocoa // // Created by Koen van der Drift on 4/5/05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "TestBCSequenceProperties.h" @implementation TestBCSequenceProperties - (void)testSequenceProperties { BCSequence *sequence; BCToolMassCalculator *calculator; NSNumber *expected, *obtained; float accuracy; sequence = [BCSequence sequenceWithString:@"KPYTREDFRQWERTYIPLKHGFDSACVNM"]; calculator = [BCToolMassCalculator massCalculatorWithSequence: sequence]; accuracy = 0.05; [calculator setMassType: BCMonoisotopic]; expected = [NSNumber numberWithFloat: (3587.7316 - hydrogenMonoisotopicMass)]; obtained = [[calculator calculateMass] objectAtIndex: 0]; STAssertEqualsWithAccuracy([expected floatValue], [obtained floatValue], accuracy, @"The MW should be %f but is %f", [expected floatValue], [obtained floatValue] ); [calculator setMassType: BCAverage]; expected = [NSNumber numberWithFloat: (3590.1056 - hydrogenAverageMass)]; obtained = [[calculator calculateMass] objectAtIndex: 0]; STAssertEqualsWithAccuracy([expected floatValue], [obtained floatValue], accuracy, @"The MW should be %f but is %f", [expected floatValue], [obtained floatValue] ); } @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCSequenceProteinInit.h000644 000765 000024 00000000364 10404057133 025442 0ustar00scottcstaff000000 000000 // // TestBCSequenceProteinInit.h // BioCocoa-test // /* Tests for the initializers of BCSequenceProtein. See implementation file */ #import @interface TestBCSequenceProteinInit : SenTestCase { } @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCSequenceProteinInit.m000644 000765 000024 00000027704 10404057133 025456 0ustar00scottcstaff000000 000000 // // TestBCSequenceProteinInit.m // BioCocoa-test // /* NEEDS TO BE UPDATED - TEMPORARILY REMOVED FROM Test - BCFoundation TARGET */ #import "TestBCSequenceProteinInit.h" @implementation TestBCSequenceProteinInit //initializer with string //using default symbol set //all known symbols - (void)testInitStringKnownSymbols { NSString *initial,*expected,*obtained; BCSequenceProtein *sequence; initial= @"ACDEFGHIKLMNPQRSTVWYBZ"; expected=@"ACDEFGHIKLMNPQRSTVWYBZ"; sequence=[BCSequenceProtein sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCProteinSequence) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //some unknown symbols - (void)testInitStringUnknownSymbols { NSString *initial,*expected,*obtained; BCSequenceProtein *sequence; initial= @"ABCDEFGHIJKLMNOPQRSTUVWXYZ(123)ACDEFGHIKL[87~!]MNPQRSTVWYBZ"; expected=@"ABCDEFGHIKLMNPQRSTVWYZACDEFGHIKLMNPQRSTVWYBZ"; sequence=[BCSequenceProtein sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCProteinSequence) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //empty string - (void)testInitStringEmptyString { NSString *initial,*expected,*obtained; BCSequenceProtein *sequence; initial= @""; expected=@""; sequence=[BCSequenceProtein sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCProteinSequence) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //string composed only of unknown symbols - (void)testInitStringAllUnknown { NSString *initial,*expected,*obtained; BCSequenceProtein *sequence; initial= @"JOUX123458()%$#@!#"; expected=@""; sequence=[BCSequenceProtein sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCProteinSequence) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using strict symbol set //all known symbols - (void)testInitStringStrictSymbolSetKnownSymbols { NSString *initial,*expected,*obtained; BCSequenceProtein *sequence; initial= @"ACDEFGHIKLMNPQRSTVWY"; expected=@"ACDEFGHIKLMNPQRSTVWY"; sequence=[BCSequenceProtein sequenceWithString:initial symbolSet:[BCSymbolSet proteinStrictSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCProteinSequence) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinStrictSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinStrictSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using strict symbol set //some unknown symbols - (void)testInitStringStrictSymbolSetUnknownSymbols { NSString *initial,*expected,*obtained; BCSequenceProtein *sequence; initial= @"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; expected=@"ACDEFGHIKLMNPQRSTVWY"; sequence=[BCSequenceProtein sequenceWithString:initial symbolSet:[BCSymbolSet proteinStrictSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCProteinSequence) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinStrictSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinStrictSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using symbol set of the wrong type --> default symbol set //some unknown symbols - (void)testInitStringWrongSymbolSet { NSString *initial,*expected,*obtained; BCSequenceProtein *sequence; initial= @"ABCDEFGHIJKLMNOPQRSTUVWXYZ(123)ACDEFGHIKL[87~!]MNPQRSTVWYBZ"; expected=@"ABCDEFGHIKLMNPQRSTVWYZACDEFGHIKLMNPQRSTVWYBZ"; sequence=[BCSequenceProtein sequenceWithString:initial symbolSet:[BCSymbolSet rnaSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCProteinSequence) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet proteinSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet proteinSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using custom symbol set - (void)testInitStringCustomSymbolSet { NSString *initial,*expected,*obtained; BCSequenceProtein *sequence; BCSymbolSet *set; initial= @"ATGJOUX(87)TTGGAGGACGTRYMKSWHBVDNATGGGTTACNGAGHBCG123T"; expected=@"AAAAAA"; set=[BCSymbolSet symbolSetWithString:@"A" sequenceType:BCProteinSequence]; sequence=[BCSequenceProtein sequenceWithString:initial symbolSet:set]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCProteinSequence) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=set) [error appendFormat:@"Symbol set should be %@ but is %@\n", set,[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using empty symbol set - (void)testInitStringEmptySymbolSet { NSString *initial,*expected,*obtained; BCSequenceProtein *sequence; BCSymbolSet *set; initial= @"ATGJOUX(87)TTGGAGGACGTRYMKSWHBVDNATGGGTTACNGAGHBCG123T"; expected=@""; set=[BCSymbolSet symbolSetWithString:@"" sequenceType:BCProteinSequence]; sequence=[BCSequenceProtein sequenceWithString:initial symbolSet:set]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCProteinSequence) [error appendFormat:@"Sequence should be protein but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=set) [error appendFormat:@"Symbol set should be %@ but is %@\n", set,[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCSequenceReader.h000644 000765 000024 00000003212 11223237412 024373 0ustar00scottcstaff000000 000000 // // TestBCSequenceReader.h // BioCocoa // // Created by Scott Christley on 9/20/07. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import @interface TestBCSequenceReader : SenTestCase { } @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCSequenceReader.m000644 000765 000024 00000046276 11223237412 024421 0ustar00scottcstaff000000 000000 // // TestBCSequenceReader.m // BioCocoa // // Created by Scott Christley on 9/20/07. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "TestBCSequenceReader.h" @implementation TestBCSequenceReader // read fasta format, DNA - (void)testReadDNAFastaFile { NSBundle *aBundle = [NSBundle bundleForClass: [self class]]; NSString *fileName = [aBundle pathForResource: @"test" ofType: @"fa"]; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; BCSequenceArray *sequenceArray = [sequenceReader readFileUsingPath: fileName format: BCFastaFileFormat]; // errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequenceArray == nil) [error appendString: @"Sequence array is nil\n"]; else { if ([sequenceArray count] != 2) [error appendFormat: @"Number of sequence in array is incorrect, 2 != %d\n", [sequenceArray count]]; else { BCSequence *aSeq = [sequenceArray sequenceAtIndex: 0]; if ([aSeq length] != 517) [error appendFormat: @"Length of sequence is incorrect, 517 != %d\n", [aSeq length]]; NSString *s = [aSeq sequenceString]; NSRange r = [s rangeOfString: @"GACGGAGATTGGCCCTCGAGTGC"]; if ((r.location != 0) || (r.length != 23)) [error appendString: @"Incorrect sequence data at beginning of sequence\n"]; r = [s rangeOfString: @"CCCACCCCAAGATGAGTGCTCTCCTATTCC"]; if ((r.location != 487) || (r.length != 30)) [error appendString: @"Incorrect sequence data at end of sequence\n"]; if ([aSeq sequenceType] != BCSequenceTypeDNA) [error appendString: @"Sequence is not type BCSequenceTypeDNA\n"]; } } // if error!=@"", the test failed STAssertTrue ([error isEqualToString:@""], error); } // read fasta format, protein - (void)testReadProteinFastaFile { NSBundle *aBundle = [NSBundle bundleForClass: [self class]]; NSString *fileName = [aBundle pathForResource: @"transposon" ofType: @"fasta"]; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; BCSequenceArray *sequenceArray = [sequenceReader readFileUsingPath: fileName format: BCFastaFileFormat]; // errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequenceArray == nil) [error appendString: @"Sequence array is nil\n"]; else { if ([sequenceArray count] != 50) [error appendFormat: @"Number of sequence in array is incorrect, 50 != %d\n", [sequenceArray count]]; else { BCSequence *aSeq = [sequenceArray sequenceAtIndex: 0]; if ([aSeq length] != 594) [error appendFormat: @"Length of sequence is incorrect, 602 != %d\n", [aSeq length]]; NSString *s = [aSeq sequenceString]; NSRange r = [s rangeOfString: @"MGSSLDDEHILSALLQS"]; if ((r.location != 0) || (r.length != 17)) [error appendString: @"Incorrect sequence data at beginning of sequence\n"]; r = [s rangeOfString: @"ICREHNIDMCQSCF"]; if ((r.location != 580) || (r.length != 14)) [error appendString: @"Incorrect sequence data at end of sequence\n"]; if ([aSeq sequenceType] != BCSequenceTypeProtein) [error appendString: @"Sequence is not type BCSequenceTypeProtein\n"]; } } // if error!=@"", the test failed STAssertTrue ([error isEqualToString:@""], error); } // read MacVector format, DNA - (void)testReadDNAMacVectorFile { NSBundle *aBundle = [NSBundle bundleForClass: [self class]]; NSString *fileName = [aBundle pathForResource: @"pBR322" ofType: nil]; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; BCSequenceArray *sequenceArray = [sequenceReader readFileUsingPath: fileName format: BCMacVectorFileFormat]; // errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequenceArray == nil) [error appendString: @"Sequence array is nil\n"]; else { if ([sequenceArray count] != 1) [error appendFormat: @"Number of sequence in array is incorrect, 1 != %d\n", [sequenceArray count]]; else { BCSequence *aSeq = [sequenceArray sequenceAtIndex: 0]; if ([aSeq length] != 4361) [error appendFormat: @"Length of sequence is incorrect, 4361 != %d\n", [aSeq length]]; NSString *s = [aSeq sequenceString]; NSRange r = [s rangeOfString: @"TTCTCATGTTTGACAGCTTA"]; if ((r.location != 0) || (r.length != 20)) [error appendString: @"Incorrect sequence data at beginning of sequence\n"]; r = [s rangeOfString: @"GGCGTATCACGAGGCCCTTTCGTCTTCAAGAA"]; if ((r.location != 4329) || (r.length != 32)) [error appendString: @"Incorrect sequence data at end of sequence\n"]; if ([aSeq sequenceType] != BCSequenceTypeDNA) [error appendString: @"Sequence is not type BCSequenceTypeDNA\n"]; } } // if error!=@"", the test failed STAssertTrue ([error isEqualToString:@""] ,error); } // read MacVector format, protein - (void)testReadProteinMacVectorFile { NSBundle *aBundle = [NSBundle bundleForClass: [self class]]; NSString *fileName = [aBundle pathForResource: @"UBBYB" ofType: nil]; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; BCSequenceArray *sequenceArray = [sequenceReader readFileUsingPath: fileName format: BCMacVectorFileFormat]; // errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequenceArray == nil) [error appendString: @"Sequence array is nil\n"]; else { if ([sequenceArray count] != 1) [error appendFormat: @"Number of sequence in array is incorrect, 1 != %d\n", [sequenceArray count]]; else { BCSequence *aSeq = [sequenceArray sequenceAtIndex: 0]; if ([aSeq length] != 457) [error appendFormat: @"Length of sequence is incorrect, 457 != %d\n", [aSeq length]]; NSString *s = [aSeq sequenceString]; NSRange r = [s rangeOfString: @"MREIIHISTGQC"]; if ((r.location != 0) || (r.length != 12)) [error appendString: @"Incorrect sequence data at beginning of sequence\n"]; r = [s rangeOfString: @"QNQDEPITENFE"]; if ((r.location != 445) || (r.length != 12)) [error appendString: @"Incorrect sequence data at end of sequence\n"]; if ([aSeq sequenceType] != BCSequenceTypeProtein) [error appendString: @"Sequence is not type BCSequenceTypeProtein\n"]; } } // if error!=@"", the test failed STAssertTrue ([error isEqualToString:@""] ,error); } // read Strider format, DNA - (void)testReadDNAStriderFile { NSBundle *aBundle = [NSBundle bundleForClass: [self class]]; NSString *fileName = [aBundle pathForResource: @"hB2AR-CDS" ofType: @"xdna"]; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; BCSequenceArray *sequenceArray = [sequenceReader readFileUsingPath: fileName format: BCStriderFileFormat]; // errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequenceArray == nil) [error appendString: @"Sequence array is nil\n"]; else { if ([sequenceArray count] != 1) [error appendFormat: @"Number of sequence in array is incorrect, 1 != %d\n", [sequenceArray count]]; else { BCSequence *aSeq = [sequenceArray sequenceAtIndex: 0]; if ([aSeq length] != 1242) [error appendFormat: @"Length of sequence is incorrect, 1242 != %d\n", [aSeq length]]; NSString *s = [aSeq sequenceString]; NSRange r = [s rangeOfString: @"ATGGGGCAACCCGGGAACGG"]; if ((r.location != 0) || (r.length != 20)) [error appendString: @"Incorrect sequence data at beginning of sequence\n"]; r = [s rangeOfString: @"AGGAATTGTAGTACAAATGACTCACTGCTGTAG"]; if ((r.location != 1209) || (r.length != 33)) [error appendString: @"Incorrect sequence data at end of sequence\n"]; if ([aSeq sequenceType] != BCSequenceTypeDNA) [error appendString: @"Sequence is not type BCSequenceTypeDNA\n"]; } } // if error!=@"", the test failed STAssertTrue ([error isEqualToString:@""] ,error); } // read Strider format, circular DNA - (void)testReadCircularDNAStriderFile { NSBundle *aBundle = [NSBundle bundleForClass: [self class]]; NSString *fileName = [aBundle pathForResource: @"pCDNA3" ofType: @"xdna"]; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; BCSequenceArray *sequenceArray = [sequenceReader readFileUsingPath: fileName format: BCStriderFileFormat]; // errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequenceArray == nil) [error appendString: @"Sequence array is nil\n"]; else { if ([sequenceArray count] != 1) [error appendFormat: @"Number of sequence in array is incorrect, 1 != %d\n", [sequenceArray count]]; else { BCSequence *aSeq = [sequenceArray sequenceAtIndex: 0]; if ([aSeq length] != 5446) [error appendFormat: @"Length of sequence is incorrect, 5446 != %d\n", [aSeq length]]; NSString *s = [aSeq sequenceString]; NSRange r = [s rangeOfString: @"GACGGATCGGGAGATCTCCCGATCCCCT"]; if ((r.location != 0) || (r.length != 28)) [error appendString: @"Incorrect sequence data at beginning of sequence\n"]; r = [s rangeOfString: @"TTTCCCCGAAAAGTGCCACCTGACGTC"]; if ((r.location != 5419) || (r.length != 27)) [error appendString: @"Incorrect sequence data at end of sequence\n"]; if ([aSeq sequenceType] != BCSequenceTypeDNA) [error appendString: @"Sequence is not type BCSequenceTypeDNA\n"]; } } // if error!=@"", the test failed STAssertTrue ([error isEqualToString:@""] ,error); } // read Strider format, protein - (void)testReadProteinStriderFile { NSBundle *aBundle = [NSBundle bundleForClass: [self class]]; NSString *fileName = [aBundle pathForResource: @"hB2AR-protein" ofType: @"xprt"]; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; BCSequenceArray *sequenceArray = [sequenceReader readFileUsingPath: fileName format: BCStriderFileFormat]; // errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequenceArray == nil) [error appendString: @"Sequence array is nil\n"]; else { if ([sequenceArray count] != 1) [error appendFormat: @"Number of sequence in array is incorrect, 1 != %d\n", [sequenceArray count]]; else { BCSequence *aSeq = [sequenceArray sequenceAtIndex: 0]; if ([aSeq length] != 413) [error appendFormat: @"Length of sequence is incorrect, 413 != %d\n", [aSeq length]]; NSString *s = [aSeq sequenceString]; NSRange r = [s rangeOfString: @"MGQPGNGSAFLLAP"]; if ((r.location != 0) || (r.length != 14)) [error appendString: @"Incorrect sequence data at beginning of sequence\n"]; r = [s rangeOfString: @"PSDNIDSQGRNCSTNDSLL"]; if ((r.location != 394) || (r.length != 19)) [error appendString: @"Incorrect sequence data at end of sequence\n"]; if ([aSeq sequenceType] != BCSequenceTypeProtein) [error appendString: @"Sequence is not type BCSequenceTypeProtein\n"]; } } // if error!=@"", the test failed STAssertTrue ([error isEqualToString:@""] ,error); } // read GCK format, DNA - (void)testReadDNAGCKFile { NSBundle *aBundle = [NSBundle bundleForClass: [self class]]; NSString *fileName = [aBundle pathForResource: @"hB26H-N,S oligos" ofType: nil]; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; BCSequenceArray *sequenceArray = [sequenceReader readFileUsingPath: fileName format: BCGCKFileFormat]; // errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequenceArray == nil) [error appendString: @"Sequence array is nil\n"]; else { if ([sequenceArray count] != 1) [error appendFormat: @"Number of sequence in array is incorrect, 1 != %d\n", [sequenceArray count]]; else { BCSequence *aSeq = [sequenceArray sequenceAtIndex: 0]; if ([aSeq length] != 1278) [error appendFormat: @"Length of sequence is incorrect, 1278 != %d\n", [aSeq length]]; NSString *s = [aSeq sequenceString]; NSRange r = [s rangeOfString: @"AAGGACGATGATGACGCCATG"]; if ((r.location != 0) || (r.length != 21)) [error appendString: @"Incorrect sequence data at beginning of sequence\n"]; r = [s rangeOfString: @"CATCATCACCATCACTAG"]; if ((r.location != 1260) || (r.length != 18)) [error appendString: @"Incorrect sequence data at end of sequence\n"]; if ([aSeq sequenceType] != BCSequenceTypeDNA) [error appendString: @"Sequence is not type BCSequenceTypeDNA\n"]; } } // if error!=@"", the test failed STAssertTrue ([error isEqualToString:@""] ,error); } // read GCK format, circular DNA - (void)testReadCircularDNAGCKFile { NSBundle *aBundle = [NSBundle bundleForClass: [self class]]; NSString *fileName = [aBundle pathForResource: @"pvL1392-SFhB26H" ofType: nil]; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; BCSequenceArray *sequenceArray = [sequenceReader readFileUsingPath: fileName format: BCGCKFileFormat]; // errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequenceArray == nil) [error appendString: @"Sequence array is nil\n"]; else { if ([sequenceArray count] != 1) [error appendFormat: @"Number of sequence in array is incorrect, 1 != %d\n", [sequenceArray count]]; else { BCSequence *aSeq = [sequenceArray sequenceAtIndex: 0]; if ([aSeq length] != 10998) [error appendFormat: @"Length of sequence is incorrect, 10998 != %d\n", [aSeq length]]; NSString *s = [aSeq sequenceString]; NSRange r = [s rangeOfString: @"AGCTTTACTCGTAAAGCGAGTTGAAGGATCATATTTA"]; if ((r.location != 0) || (r.length != 37)) [error appendString: @"Incorrect sequence data at beginning of sequence\n"]; r = [s rangeOfString: @"CGACGTTGTAAAACGACGGCCAGTGCC"]; if ((r.location != 10971) || (r.length != 27)) [error appendString: @"Incorrect sequence data at end of sequence\n"]; if ([aSeq sequenceType] != BCSequenceTypeDNA) [error appendString: @"Sequence is not type BCSequenceTypeDNA\n"]; } } // if error!=@"", the test failed STAssertTrue ([error isEqualToString:@""] ,error); } // read FASTQ format, DNA and quality scores - (void)testReadFASTQFile { NSBundle *aBundle = [NSBundle bundleForClass: [self class]]; NSString *fileName = [aBundle pathForResource: @"test" ofType: @"fastq"]; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; BCSequenceArray *sequenceArray = [sequenceReader readFileUsingPath: fileName format: BCFASTQFileFormat]; // errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequenceArray == nil) [error appendString: @"Sequence array is nil\n"]; else { if ([sequenceArray count] != 7) [error appendFormat: @"Number of sequence in array is incorrect, 7 != %d\n", [sequenceArray count]]; else { BCSequence *aSeq = [sequenceArray sequenceAtIndex: 0]; if ([aSeq length] != 157) [error appendFormat: @"Length of sequence is incorrect, 157 != %d\n", [aSeq length]]; NSString *s = [aSeq sequenceString]; NSRange r = [s rangeOfString: @"AGGCGTATGCCACCAAGCCC"]; if ((r.location != 0) || (r.length != 20)) [error appendString: @"Incorrect sequence data at beginning of sequence\n"]; r = [s rangeOfString: @"CCGAAAGGGTTTGAATTCAA"]; if ((r.location != 137) || (r.length != 20)) [error appendString: @"Incorrect sequence data at end of sequence\n"]; if ([aSeq sequenceType] != BCSequenceTypeDNA) [error appendString: @"Sequence is not type BCSequenceTypeDNA\n"]; BCAnnotation *a = [aSeq annotationForKey: @"quality"]; s = (NSString *)[a content]; if ([s length] != 157) [error appendFormat: @"Length of quality score is incorrect, 157 != %d\n", [s length]]; r = [s rangeOfString: @"DDDDDDDDDDDDDDDDDDDD"]; if ((r.location != 0) || (r.length != 20)) [error appendString: @"Incorrect data at beginning of quality scores\n"]; r = [s rangeOfString: @"><<<<<<>>"]; if ((r.location != 137) || (r.length != 20)) [error appendString: @"Incorrect data at end of quality scores\n"]; } } // if error!=@"", the test failed STAssertTrue ([error isEqualToString:@""], error); } // read Clustal format #if 0 // not working - (void)testReadClustalFile { NSBundle *aBundle = [NSBundle bundleForClass: [self class]]; NSString *fileName = [aBundle pathForResource: @"transposon" ofType: @"clustalw"]; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; BCSequenceArray *sequenceArray = [sequenceReader readFileUsingPath: fileName format: BCClustalFileFormat]; // errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequenceArray == nil) [error appendString: @"Sequence array is nil\n"]; else { if ([sequenceArray count] != 1) [error appendFormat: @"Number of sequence in array is incorrect, 1 != %d\n", [sequenceArray count]]; else { BCSequence *aSeq = [sequenceArray sequenceAtIndex: 0]; if ([aSeq length] != 10998) [error appendFormat: @"Length of sequence is incorrect, 10998 != %d\n", [aSeq length]]; NSString *s = [aSeq sequenceString]; NSRange r = [s rangeOfString: @"AGCTTTACTCGTAAAGCGAGTTGAAGGATCATATTTA"]; if ((r.location != 0) || (r.length != 37)) [error appendString: @"Incorrect sequence data at beginning of sequence\n"]; r = [s rangeOfString: @"CGACGTTGTAAAACGACGGCCAGTGCC"]; if ((r.location != 10971) || (r.length != 27)) [error appendString: @"Incorrect sequence data at end of sequence\n"]; } } // if error!=@"", the test failed STAssertTrue ([error isEqualToString:@""] ,error); } #endif @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCSequenceRNAInit.h000644 000765 000024 00000000350 10404057133 024435 0ustar00scottcstaff000000 000000 // // TestBCSequenceRNAInit.h // BioCocoa-test // /* Tests for the initializers of BCSequenceRNA. See implementation file */ #import @interface TestBCSequenceRNAInit : SenTestCase { } @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCSequenceRNAInit.m000644 000765 000024 00000037641 10404057133 024457 0ustar00scottcstaff000000 000000 // // TestBCSequenceRNAInit.m // BioCocoa-test // /* NEEDS TO BE UPDATED - TEMPORARILY REMOVED FROM Test - BCFoundation TARGET */ #import "TestBCSequenceRNAInit.h" @implementation TestBCSequenceRNAInit //initializer with string //using default symbol set //all known symbols - (void)testInitStringKnownSymbols { NSString *initial,*expected,*obtained; BCSequenceRNA *sequence; initial= @"AUGUUGGAGGAUGGGUUACGACGURYMKSWHBVDNAGCGU"; expected=@"AUGUUGGAGGAUGGGUUACGACGURYMKSWHBVDNAGCGU"; sequence=[BCSequenceRNA sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCRNASequence) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //some unknown symbols - (void)testInitStringUnknownSymbols { NSString *initial,*expected,*obtained; BCSequenceRNA *sequence; initial= @"AUG(87)UUGGAGGAUGGGUUACGACGURYMK[128~]SWHBVDNAGCGU"; expected=@"AUGUUGGAGGAUGGGUUACGACGURYMKSWHBVDNAGCGU"; sequence=[BCSequenceRNA sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCRNASequence) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //empty string - (void)testInitStringEmptyString { NSString *initial,*expected,*obtained; BCSequenceRNA *sequence; initial= @""; expected=@""; sequence=[BCSequenceRNA sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCRNASequence) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set //string composed only of unknown symbols - (void)testInitStringAllUnknown { NSString *initial,*expected,*obtained; BCSequenceRNA *sequence; initial= @"123458()%$#@!#"; expected=@""; sequence=[BCSequenceRNA sequenceWithString:initial]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCRNASequence) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using strict symbol set //all known symbols - (void)testInitStringStrictSymbolSetKnownSymbols { NSString *initial,*expected,*obtained; BCSequenceRNA *sequence; initial= @"AUGUUGGAGGAUGGGUUACGAGCGU"; expected=@"AUGUUGGAGGAUGGGUUACGAGCGU"; sequence=[BCSequenceRNA sequenceWithString:initial symbolSet:[BCSymbolSet rnaStrictSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCRNASequence) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaStrictSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaStrictSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using strict symbol set //some unknown symbols - (void)testInitStringStrictSymbolSetUnknownSymbols { NSString *initial,*expected,*obtained; BCSequenceRNA *sequence; initial= @"AUG(87)UUGGAGGACGURYMKSWHBVDNAUGGGUUACNGAGHBCG123U"; expected=@"AUGUUGGAGGACGUAUGGGUUACGAGCGU"; sequence=[BCSequenceRNA sequenceWithString:initial symbolSet:[BCSymbolSet rnaStrictSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCRNASequence) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaStrictSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaStrictSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using symbol set of the wrong type --> default symbol set //some unknown symbols - (void)testInitStringWrongSymbolSet { NSString *initial,*expected,*obtained; BCSequenceRNA *sequence; initial= @"AUG(87)UUGGAGGAUGGGUUACGACGURYMK[128~]SWHBVDNAGCG123U"; expected=@"AUGUUGGAGGAUGGGUUACGACGURYMKSWHBVDNAGCGU"; sequence=[BCSequenceRNA sequenceWithString:initial symbolSet:[BCSymbolSet dnaSymbolSet]]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCRNASequence) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using custom symbol set - (void)testInitStringCustomSymbolSet { NSString *initial,*expected,*obtained; BCSequenceRNA *sequence; BCSymbolSet *set; initial= @"AUG(87)UUGGAGGACGURYMKSWHBVDNAUGGGUUACNGAGHBCG123U"; expected=@"AAAAAA"; set=[BCSymbolSet symbolSetWithString:@"A" sequenceType:BCRNASequence]; sequence=[BCSequenceRNA sequenceWithString:initial symbolSet:set]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCRNASequence) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=set) [error appendFormat:@"Symbol set should be %@ but is %@\n", set,[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using empty symbol set - (void)testInitStringEmptySymbolSet { NSString *initial,*expected,*obtained; BCSequenceRNA *sequence; BCSymbolSet *set; initial= @"AUG(87)UUGGAGGACGURYMKSWHBVDNAUGGGUUACNGAGHBCG123U"; expected=@""; set=[BCSymbolSet symbolSetWithString:@"" sequenceType:BCRNASequence]; sequence=[BCSequenceRNA sequenceWithString:initial symbolSet:set]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCRNASequence) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=set) [error appendFormat:@"Symbol set should be %@ but is %@\n", set,[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set, converting thymidines = YES //all known symbols //No U, only Ts - (void)testInitStringKnownSymbolsConvertingThymidinesYes { NSString *initial,*expected,*obtained; BCSequenceRNA *sequence; initial= @"ATGTTGGAGGATGGGTTACGACGTRYMKSWHBVDNAGCGT"; expected=@"AUGUUGGAGGAUGGGUUACGACGURYMKSWHBVDNAGCGU"; sequence=[[[BCSequenceRNA alloc] initWithString:initial convertingThymidines:YES] autorelease]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCRNASequence) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set, converting thymidines = NO //all known symbols //No U, only Ts - (void)testInitStringKnownSymbolsConvertingThymidinesNo { NSString *initial,*expected,*obtained; BCSequenceRNA *sequence; initial= @"ATGTTGGAGGATGGGTTACGACGTRYMKSWHBVDNAGCGT"; expected=@"AGGGAGGAGGGACGACGRYMKSWHBVDNAGCG"; sequence=[[[BCSequenceRNA alloc] initWithString:initial convertingThymidines:NO] autorelease]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCRNASequence) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } //initializer with string //using default symbol set, converting thymidines = YES //all known symbols //Some U, some Ts - (void)testInitStringKnownSymbolsConvertingThymidinesYesMixUT { NSString *initial,*expected,*obtained; BCSequenceRNA *sequence; initial= @"ATGTUGGAGGAUGGGUUACGACGTRYMKSWHBVDNAGCGT"; expected=@"AUGUUGGAGGAUGGGUUACGACGURYMKSWHBVDNAGCGU"; sequence=[[[BCSequenceRNA alloc] initWithString:initial convertingThymidines:YES] autorelease]; obtained=[sequence sequenceString]; //all the errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (sequence==nil) [error appendString:@"Sequence is nil\n"]; if (![obtained isEqual:expected]) [error appendFormat:@"Sequence should be %@, but is %@\n", expected,obtained]; if ([sequence sequenceType]!=BCRNASequence) [error appendFormat:@"Sequence should be RNA but is %d\n", [sequence sequenceType]]; if ([sequence symbolSet]!=[BCSymbolSet rnaSymbolSet]) [error appendFormat:@"Symbol set should be %@ but is %@\n", [BCSymbolSet rnaSymbolSet],[sequence symbolSet]]; if ([[sequence symbolSet] sequenceType]!=[sequence sequenceType]) [error appendFormat:@"The symbol set is of type %d but should be of type %d, the same type as the sequence\n", [[sequence symbolSet] sequenceType],[sequence sequenceType]]; //if error!=@"", the test failed STAssertTrue ( [error isEqualToString:@""],error); } @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCSuffixArray.h000644 000765 000024 00000003207 11223237412 023747 0ustar00scottcstaff000000 000000 // // TestBCSuffixArray.h // BioCocoa // // Created by Scott Christley on 9/24/07. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // #import @interface TestBCSuffixArray : SenTestCase { } @end biococoa-2.2.2/Tests/Test-BCFoundation/TestBCSuffixArray.m000644 000765 000024 00000015346 11223237412 023763 0ustar00scottcstaff000000 000000 // // TestBCSuffixArray.m // BioCocoa // // Created by Scott Christley on 9/24/07. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // #import "TestBCSuffixArray.h" @implementation TestBCSuffixArray // test construct suffix array #if 0 // disable for now as inMemory suffix array needs to be reworked - (void)testMemoryConstructSuffixArray { NSBundle *aBundle = [NSBundle bundleForClass: [self class]]; NSString *fileName = [aBundle pathForResource: @"test" ofType: @"fa"]; BCSuffixArray *anArray = [[BCSuffixArray alloc] init]; // errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (anArray == nil) [error appendString: @"Suffix array is nil\n"]; else { // construct the suffix array if (![anArray constructFromSequenceFile: fileName strand: nil]) [error appendString: @"Error while constructing suffix array\n"]; if ([anArray numberOfSequences] != 2) [error appendFormat: @"Number of sequence in array is incorrect, 2 != %d\n", [anArray numberOfSequences]]; else { BCSequenceArray *sequenceArray = [anArray sequenceArray]; NSDictionary *metaDictionary = [anArray metaDictionary]; if (metaDictionary == nil) [error appendString: @"Meta dictionary is nil\n"]; else { if ([[metaDictionary objectForKey: @"length"] intValue] != 619) [error appendFormat: @"Total length of sequences is incorrect, 619 != %@\n", [metaDictionary objectForKey: @"length"]]; BCSequence *aSeq = [sequenceArray sequenceAtIndex: 0]; if ([aSeq length] != 517) [error appendFormat: @"Length of sequence is incorrect, 517 != %d\n", [aSeq length]]; } } } // if error!=@"", the test failed STAssertTrue ([error isEqualToString:@""], error); } #endif // test construct suffix array - (void)testFileConstructSuffixArray { NSBundle *aBundle = [NSBundle bundleForClass: [self class]]; NSString *fileName = [aBundle pathForResource: @"test" ofType: @"fa"]; // delete temporary files NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *s = [fileName stringByAppendingPathExtension: @"sa"]; if ([fileManager fileExistsAtPath: s]) [fileManager removeFileAtPath: s handler: nil]; s = [fileName stringByAppendingPathExtension: @"meta_sa"]; if ([fileManager fileExistsAtPath: s]) [fileManager removeFileAtPath: s handler: nil]; BCSuffixArray *anArray = [[BCSuffixArray alloc] init]; // errors are concatenated NSMutableString *error=[NSMutableString stringWithString:@""]; if (anArray == nil) [error appendString: @"Suffix array is nil\n"]; else { // construct the suffix array if (![anArray constructFromSequenceFile: fileName strand: nil]) [error appendString: @"Error while constructing suffix array\n"]; // write to disk if (![anArray writeToFile: fileName withMasking: YES]) [error appendFormat: @"Error while writing suffix array to file: %@\n", fileName]; [anArray release]; // read from disk anArray = [[BCSuffixArray alloc] initWithContentsOfFile: fileName inMemory: NO]; if (anArray == nil) [error appendFormat: @"Could not read suffix array from file: %@\n", fileName]; else { if ([anArray numberOfSequences] != 2) [error appendFormat: @"Number of sequence in array is incorrect, 2 != %d\n", [anArray numberOfSequences]]; else { BCSequenceArray *sequenceArray = [anArray sequenceArray]; NSDictionary *metaDictionary = [anArray metaDictionary]; if (metaDictionary == nil) [error appendString: @"Meta-dictionary is nil\n"]; else { if ([[metaDictionary objectForKey: @"length"] intValue] != 619) [error appendFormat: @"Total length of sequences in meta-dictionary is incorrect, 619 != %@\n", [metaDictionary objectForKey: @"length"]]; NSArray *seqs = [metaDictionary objectForKey: @"sequences"]; if (!seqs) [error appendString: @"Meta-dictionary missing sequences\n"]; NSDictionary *d = [seqs objectAtIndex: 0]; int aValue = [[d objectForKey: @"length"] intValue]; if (aValue != 517) [error appendFormat: @"Length of sequence in meta-dictionary is incorrect, 517 != %d\n", aValue]; aValue = [[d objectForKey: @"number"] intValue]; if (aValue != 0) [error appendFormat: @"Sequence number in meta-dictionary is incorrect, 0 != %d\n", aValue]; d = [seqs objectAtIndex: 1]; aValue = [[d objectForKey: @"length"] intValue]; if (aValue != 102) [error appendFormat: @"Length of sequence in meta-dictionary is incorrect, 102 != %d\n", aValue]; aValue = [[d objectForKey: @"number"] intValue]; if (aValue != 1) [error appendFormat: @"Sequence number in meta-dictionary is incorrect, 1 != %d\n", aValue]; BCSequence *aSeq = [sequenceArray sequenceAtIndex: 0]; if ([aSeq length] != 517) [error appendFormat: @"Length of sequence is incorrect, 517 != %d\n", [aSeq length]]; aSeq = [sequenceArray sequenceAtIndex: 1]; if ([aSeq length] != 102) [error appendFormat: @"Length of sequence is incorrect, 102 != %d\n", [aSeq length]]; } } } } // if error!=@"", the test failed STAssertTrue ([error isEqualToString:@""], error); } @end biococoa-2.2.2/Tests/Test-BCFoundation/DataFiles/hB26H-N,S oligos000755 000765 000024 00000026431 10675026741 024547 0ustar00scottcstaff000000 000000 zSAAGGACGATGATGACGCCATGGGGCAACCCGGGAACGGCAGCGCCTTCTTGCTGGCACCCAATAGAAGCCATGCGCCGGACCACGACGTCACGCAGCAAAGGGACGAGGTGTGGGTGGTGGGCATGGGCATCGTCATGTCTCTCATCGTCCTGGCCATCGTGTTTGGCAATGTGCTGGTCATCACAGCCATTGCCAAGTTCGAGCGTCTGCAGACGGTCACCAACTACTTCATCACTTCACTGGCCTGTGCTGATCTGGTCATGGGCCTGGCAGTGGTGCCCTTTGGGGCCGCCCATATTCTTATGAAAATGTGGACTTTTGGCAACTTCTGGTGCGAGTTTTGGACTTCCATTGATGTGCTGTGCGTCACGGCTAGCATTGAGACCCTGTGCGTGATCGCAGTGGATCGCTACTTTGCCATTACTTCACCTTTCAAGTACCAGAGCCTGCTGACCAAGAATAAGGCCCGGGTGATCATTCTGATGGTGTGGATTGTGTCAGGCCTTACCTCCTTCTTGCCCATTCAGATGCACTGGTACCGGGCCACCCACCAGGAAGCCATCAACTGCTATGCCAATGAGACCTGCTGTGACTTCTTCACGAACCAAGCCTATGCCATTGCCTCTTCCATCGTGTCCTTCTACGTTCCCCTGGTGATCATGGTCTTCGTCTACTCCAGGGTCTTTCAGGAGGCCAAAAGGCAGCTCCAGAAGATTGACAAATCTGAGGGCCGCTTCCATGTCCAGAACCTTAGCCAGGTGGAGCAGGATGGGCGGACGGGGCATGGACTCCGCAGATCTTCCAAGTTCTGCTTGAAGGAGCACAAAGCCCTCAAGACGTTAGGCATCATCATGGGCACTTTCACCCTCTGCTGGCTGCCCTTCTTCATCGTTAACATTGTGCATGTGATCCAGGATAACCTCATCCGTAAGGAAGTTTACATCCTCCTAAATTGGATAGGCTATGTCAATTCTGGTTTCAATCCCCTTATCTACTGCCGGAGCCCAGATTTCAGGATTGCCTTCCAAGAGCTCCTGTGCCTGCGCAGGTCTTCTTTGAAGGCCTATGGGAATGGCTACTCCAGCAACGGCAACACAGGGGAGCAGAGTGGATATCACGTGGAACAGGAGAAAGAAAATAAACTGCTGTGTGAAGACCTCCCAGGCACGGAAGACTTTGTGGGCCATCAAGGTACTGTGCCTAGCGATAACATTGATTCACAAGGGAGGAATTGTAGTACAAATGACTCACTGCTGCACCATCATCACCATCACTAG "5| UUUU  kUUUU[  Ъ [l  Ъ lm  """" m  """"   """"   Ъ   Ъ   Ъ   UUUUP2  Ъ 2S  Ъ Sj  Ъ jk  Ъ kn UUUU[nv  Ъ vw UUUULw  Ъ   Ъ | UUUUP  Ъ   Ъ   Ъ   Ъ   Ъ X  Ъ Xa  Ъ aj  Ъ j  Ъ   Ъ   Ъ   UUUUX  UUUUXE  Ъ E  Ъ   Ъ   Ъ   Ъ   Ъ  UUUUP  Ъ   Ъ  UUUU  Ъ    UUUUP   Ъ #  Ъ #%d UUUU[%:d UUUU[:wd UUUU[w  Ъ L UUUUV     ` ؔ ؐ U   U ` ، ؈  k U ` ؄ ؀C  kU  |  UUU  x   UUUU  t k UUU  p    l"" " U  h"  m  d    `  אQC 3 \sF hpGEM-2pGEM-B2 from Rick LinkpGEM-2pGEM-B2 from Rick LinkpGEM-SF-E3K-H6 complete 2pGEM-B2 from Rick LinkpVL1392-SFhB26H-NheI,SacIpVL1392-SFhB26H-NheI,SacIpGEM3ZSFhB2HT-NheI/SacIpVL1392-SFhB26H-NheI,SacIpVL1392-SFhB26H-NheI,SacIpVL1392-SFhB26H-NheI,SacIpVL1392-SFhB26H-NheI,SacISFhB26H.(  X  ( )4(  T3@ ( )L!(  P{ ( )!  Ly ( )'-( U H#l ( )TZ( U Du ( )mn(  @ ( )( U <V ( )  8W ( )$U 4T ( )( U 0 ( )$11.0  ,  ( )Rg( d (J@@ ( )q( # $l ( )jk(   ( )Ztz( A f@ ( )r`Al(    ( )D(   ( )An  p ( )q9(    ( )##( !  ( )S"( " v? ( )"S( _ ?) ( )(AFP( 0 ļ ( )(gh( A  ( )t #1,ou ( ( >@ ( )2 (N( ) ? ( )=====( = > ( )/BamH( t  ( )  (   ( )H!(   ( )H<"0   ? ( )a{(  ?: ( )p|{ @ #? ( )<( P  ( )(   ( ) (  ? ( )Const   j ( )  (  ׼? ( )@ C ׸? ( )   ״ ( )P$*( H װXҀ ( )Qt%&  ׬ ( )  :;(  ר ( )W]( , פ J ( )  נ ל ( ) Fpre-NcoINcoISmaIAvaIHaeIIAatII anti-AatIIMscIEaeIBalIpre-PstI pre-BstEIIPstIBstEIIpre-NheINheI anti-NheISmaIAvaIBclIpre-StuIStuIKpnIBspMI anti-KpnIEarIIsoschizomer with Ksp632I.BclIAccI pre-BglII anti-Bgl IIBglIIXcmIHpaIHincII anti-HpaIpre-SacISst1SacIBspMIFspI anti-SacIStuI pre-EcoRV anti-EcoRVEcoRVjunction marker_This marker was generated to preserve the boundary between two segments whose ends were joined..0 (Most Recent Generation) (Oldest Generation)0 D*hd#   ?[ ( )      ט ה ( ) F<   ( ) F<CA _ v5\0" I a `@B@t `T} ah@ `M n. 1-1111 x ` `*\*Ph@ `1111 1-11111 x a05R x5h111CA1 a w P `11 P ּ a08"@ v. v@ v. n ؠ bh apBH$ ap ל. a [l b  bֱ v. n junction marker_This marker was generated to preserve the boundary between two segments whose ends were joined.SFhB26H-N,S (oligos)Standard Codon Table5\0" I e$ cB@t_ } e$x d4  1111111 x d11 c*\*Ph@ cZlS P 1-11111 x dp5R x5h111111 e$ w P d1     xUUUU   Q  ( )A8 * ?Ei lHH  0341.07 e@ p d p xˠ epB(xˠ ep ep P: ּ e}L e}L v. n ؠ# e Ԭ f p < fL v. n ؠ# f B(| Ppsequbiococoa-2.2.2/Tests/Test-BCFoundation/DataFiles/hB2AR-CDS.xdna000644 000765 000024 00000002512 10675026741 024254 0ustar00scottcstaff000000 000000 ""!""!ATGGGGCAACCCGGGAACGGCAGCGCCTTCTTGCTGGCACCCAATAGAAGCCATGCGCCGGACCACGACGTCACGCAGCAAAGGGACGAGGTGTGGGTGGTGGGCATGGGCATCGTCATGTCTCTCATCGTCCTGGCCATCGTGTTTGGCAATGTGCTGGTCATCACAGCCATTGCCAAGTTCGAGCGTCTGCAGACGGTCACCAACTACTTCATCACTTCACTGGCCTGTGCTGATCTGGTCATGGGCCTGGCAGTGGTGCCCTTTGGGGCCGCCCATATTCTTATGAAAATGTGGACTTTTGGCAACTTCTGGTGCGAGTTTTGGACTTCCATTGATGTGCTGTGCGTCACGGCCAGCATTGAGACCCTGTGCGTGATCGCAGTGGATCGCTACTTTGCCATTACTTCACCTTTCAAGTACCAGAGCCTGCTGACCAAGAATAAGGCCCGGGTGATCATTCTGATGGTGTGGATTGTGTCAGGCCTTACCTCCTTCTTGCCCATTCAGATGCACTGGTACCGGGCCACCCACCAGGAAGCCATCAACTGCTATGCCAATGAGACCTGCTGTGACTTCTTCACGAACCAAGCCTATGCCATTGCCTCTTCCATCGTGTCCTTCTACGTTCCCCTGGTGATCATGGTCTTCGTCTACTCCAGGGTCTTTCAGGAGGCCAAAAGGCAGCTCCAGAAGATTGACAAATCTGAGGGCCGCTTCCATGTCCAGAACCTTAGCCAGGTGGAGCAGGATGGGCGGACGGGGCATGGACTCCGCAGATCTTCCAAGTTCTGCTTGAAGGAGCACAAAGCCCTCAAGACGTTAGGCATCATCATGGGCACTTTCACCCTCTGCTGGCTGCCCTTCTTCATCGTTAACATTGTGCATGTGATCCAGGATAACCTCATCCGTAAGGAAGTTTACATCCTCCTAAATTGGATAGGCTATGTCAATTCTGGTTTCAATCCCCTTATCTACTGCCGGAGCCCAGATTTCAGGATTGCCTTCCAGGAGCTTCTGTGCCTGCGCAGGTCTTCTTTGAAGGCCTATGGGAATGGCTACTCCAGCAACGGCAACACAGGGGAGCAGAGTGGATATCACGTGGAACAGGAGAAAGAAAATAAACTGCTGTGTGAAGACCTCCCAGGCACGGAAGACTTTGTGGGCCATCAAGGTACTGTGCCTAGCGATAACATTGATTCACAAGGGAGGAATTGTAGTACAAATGACTCACTGCTGTAGbiococoa-2.2.2/Tests/Test-BCFoundation/DataFiles/hB2AR-protein.xprt000644 000765 000024 00000001016 10675026741 025364 0ustar00scottcstaff000000 000000 "'"'"1MGQPGNGSAFLLAPNRSHAPDHDVTQQRDEVWVVGMGIVMSLIVLAIVFGNVLVITAIAKFERLQTVTNYFITSLACADLVMGLAVVPFGAAHILMKMWTFGNFWCEFWTSIDVLCVTASIETLCVIAVDRYFAITSPFKYQSLLTKNKARVIILMVWIVSGLTSFLPIQMHWYRATHQEAINCYANETCCDFFTNQAYAIASSIVSFYVPLVIMVFVYSRVFQEAKRQLQKIDKSEGRFHVQNLSQVEQDGRTGHGLRRSSKFCLKEHKALKTLGIIMGTFTLCWLPFFIVNIVHVIQDNLIRKEVYILLNWIGYVNSGFNPLIYCRSPDFRIAFQELLCLRRSSLKAYGNGYSSNGNTGEQSGYHVEQEKENKLLCEDLPGTEDFVGHQGTVPSDNIDSQGRNCSTNDSLL*biococoa-2.2.2/Tests/Test-BCFoundation/DataFiles/pBR322000644 000765 000024 00000072765 10674547336 023020 0ustar00scottcstaff000000 000000 C`   4XX]organism=Cloning vector pBR322; db_xref=taxon:47470; tissue_lib=ATCC 31344, ATCC 37017 XX6organism=Plasmid pSC101; plasmid=Plasmid pSC101bound_moiety=echinomycinJJpromoter P1 [6]!bound_moiety=echinomycin'*JJpromoter P2 [6]+1bound_moiety=echinomycin58bound_moiety=echinomycinCFbound_moiety=echinomycinPSWWgene=tetVgene=tet; codon_start=1; transl_table=11; product=tetracycline resistance protein; db_xref=PID:g208959; translation=MKSNNALIVILGTVTLDAVGIGLVMPVLPGLLRDIVHSDSIASH YGVLLALYALMQFLCAPVLGALSDRFGRRPVLLASLLGATIDYAIMATTPVLWILYAG RIVAGITGATGAVAGAYIADITDGEDRARHFGLMSACFGVGMVAGPVAGGLLGAISLH APFLAAAVLNGLNLLLGCFLMQESHKGERRPMPLRAFNPVSSFRWARGMTIVAALMTV FFIMQLVGQVPAALWVIFGEDRFRWSATMIGLSLAVFGILHALAQAFVTGPATKRFGE KQAIIAGMAADALGYVLLAFATRGWMAFPIMILLASGGIGMPALQAMLSRQVDDDHQG QLQGSLAALTSLTSITGPLIVTAIYAASASTWNGLAWIVGAALYLVCLPALRRGAWSR ATSTV''Pgene=tet; Endo.Sce I cleavage site coordinated with site at base 146 [10]''Pgene=tet; Endo.Sce I cleavage site coordinated with site at base 142 [10])gene=tet; bound_moiety=echinomycin(gene=tet; citation=[11]; replace=)gene=tet; bound_moiety=echinomycin$$gene=tet; citation=[17]MM=gamma-delta insertion target sequence; rpt_type=direct''!from pSC101 (bp 1860-1986)dXXorganism=Unclassified. KMM=gamma-delta insertion target sequence; rpt_type=direct!citation=[23]; replace=attcd$$"citation=[2]; citation=[22]deLLqvLLShine-Dalgarno sequencequ!citation=[23]; replace=caayz$$citation=[17]z{codon_start=1; transl_except=(pos:1915..1917,aa:Met); transl_table=11; product=ROP protein; db_xref=PID:g456436; translation=MTKQEKTALNMARFIRSQTLTLLEKLNELDADEQADICESLHDH ADELYRSCLARFGDDGENL{:''-H-strand Y effector site; citation=[5]wMM=gamma-delta insertion target sequence; rpt_type=direct''-L-strand Y effector site; citation=[5] / nbound_moiety=dnaA  $$Jrevision according to [17]; citation=[2]; citation=[17]; replace=at $$citation=[17] $$Irevision according to [16]; citation=[2]; citation=[16]; replace=t $$citation=[17] XX9organism=Transposon Tn3; transposon=Transposon Tn3 L %%rcorresponds to one of the 38bp repeats found in Tn3 (bp 1-38 and complement (4920-4957)); rpt_type=inverted L qWWgene=bla 9gene=bla; E-286; codon_start=1; transl_table=11; product=beta-lactamase; db_xref=PID:g455370; translation=MSIQHFRVALIPFFAAFCLPVFAHPETLVKVKDAEDQLGARVGY IELDLNSGKILESFRPEERFPMMSTFKVLLCGAVLSRVDAGQEQLGRRIHYSQNDLVE YSPVTEKHLTDGMTVRELCSAAITMSDNTAANLLLTTIGGPKELTAFLHNMGDHVTRL DRWEPELNEAIPNDERDTTMPAAMATTLRKLLTGELLTLASRQQLIDWMEADKVAGPL LRSALPAGWFIADKSGAGERGSRGIIAALGPDGKPSRIVVIYTTGSQATMDERNRQIA EIGASLIKHW 9'gene=bla; product=beta-lactamase gene=bla9LLShine-Dalgarno sequenceAEJJpromoter P3 [6]\bbound_moiety=echinomycinbound_moiety=echinomycinbound_moiety=echinomycinbound_moiety=echinomycinbound_moiety=echinomycinbound_moiety=echinomycinbound_moiety=echinomycinc.Cloning vector pBR322, complete genome.ZJ01749 K00005 L08654 M10282 M10283 M10286 M10356 M10784 M10785 M10786 M33694 V01119ampicillin resistance; beta-lactamase; cloning vector; drug resistance protein; origin of replication; plasmid; tetracycline resistance.Cloning vector pBR322 (tissue library: ATCC 31344, ATCC 37017) DNA; Plasmid pSC101 DNA; Unclassified DNA; and Transposon Tn3 DNA.BCloning vector pBR322 artificial sequence; cloning vectors. &1 (bases 1 to 3; 3259 to 4361) Sutcliffe,J.G. _Nucleotide sequence of the ampicillin resistance gene of Escherichia coli plasmid pBR322 =Proc. Natl. Acad. Sci. U.S.A. 75 (8), 3737-3741 (1978) ľ2 (bases 1 to 4361) Sutcliffe,J.G. JComplete nucleotide sequence of the Escherichia coli plasmid pBR322 ACold Spring Harb. Symp. Quant. Biol. 43 Pt 1, 77-90 (1979) ő3 (bases 1500 to 2300) GReed,R.R., Young,R.A., Steitz,J.A., Grindley,N.D. and Guyer,M.S. fTransposition of the Escherichia coli insertion element gamma generates a five-base-pair repeat >Proc. Natl. Acad. Sci. U.S.A. 76 (10), 4882-4886 (1979) 84 (bases 2207 to 2265) Covarrubias,L., Cervantes,L., Covarrubias,A., Soberon,X., Vichido,I., Blanco,A., Kupersztoch-Portnoy,Y.M. and Bolivar,F. Construction and characterization of new cloning vehicles. V. Mobilization and coding properties of pBR322 and several deletion derivatives including pBR327 and pBR328 Gene 13 (1), 25-35 (1981) x5 (bases 2000 to 2500)"" 1Marians,K.J., Soeller,W. and Zipursky,S.L.## hMaximal limits of the Escherichia coli replication factor Y effector site sequences in pBR322 DNA$% 0J. Biol. Chem. 257 (10), 5656-5662 (1982)&& ߻56 (bases 1 to 80; 4151 to 4229; 4349 to 4361)(( 0Brosius,J., Cate,R.L. and Perlmutter,A.P.)) Precise location of two promoters for the beta-lactamase gene of pBR322. S1 mapping of ribonucleic acid isolated from Escherichia coli or synthesized in vitro*, 0J. Biol. Chem. 257 (15), 9205-9210 (1982)-- 7 (bases 4241 to 4343)// 4Van Dyke,M.W., Hertzberg,R.P. and Dervan,P.B.00 Map of distamycin, netropsin, and actinomycin binding sites on heterogeneous DNA: DNA cleavage-inhibition patterns with methidiumpropyl-EDTA.Fe(II)12 >Proc. Natl. Acad. Sci. U.S.A. 79 (18), 5470-5474 (1982)33 FQ8 (bases 584 to 709)55 Peden,K.W. and Nathans,D.66 DLocal mutagenesis within deletion loops of DNA heteroduplexes77 >Proc. Natl. Acad. Sci. U.S.A. 79 (23), 7214-7217 (1982)88 ~9 (bases 373 to 649):: Peden,K.W.;; ERevised sequence of the tetracycline-resistance gene of pBR322<< $Gene 22 (2-3), 277-280 (1983)== 10 (bases 132 to 181)?? Proc. Natl. Acad. Sci. U.S.A. 80 (22), 6795-6798 (1983)OO D13 (bases 4276 to 4336)QQ #Schultz,P.G. and Dervan,P.B.RR hSequence-specific double-strand cleavage of DNA by penta-N-methylpyrrolecarboxamide-EDTA X Fe(II)ST >Proc. Natl. Acad. Sci. U.S.A. 80 (22), 6834-6837 (1983)UU 14 (bases 518 to 528)WW Sutcliffe,J.G.XX Unpublished (1984)YY `q15 (bases 2395 to 2495)ZZ 0Fuller,R.S., Funnell,B.E. and Kornberg,A.[[ jThe dnaA protein complex with the E. coli chromosomal replication origin (oriC) and other DNA sites\] "Cell 38 (3), 889-900 (1984)^^ P16 (bases 2729 to 2731)`` 5Lathe,R., Kieny,M.P., Skory,S. and Lecocq,J.P.aa WLinker tailing: unphosphorylated linker oligonucleotides for joining DNA terminibc DNA 3 (2), 173-182 (1984)dd X17 (bases )ff 'Heusterspreute,M. and Davison,J.gg RRestriction site bank vectors. II. DNA sequence analysis of plasmid pJRD158hi DNA 3 (3), 259-268 (1984)jj ե,18 (bases 2113 to 2186; 2348 to 2415)ll .Abarzua,P., Soeller,W. and Marians,K.J.mm Mutational analysis of primosome assembly sites. I. Distinct classes of mutants in the pBR322 Escherichia coli factor Y DNA effector sequencesno 2J. Biol. Chem. 259 (22), 14286-14292 (1984)pp զ19 (bases 2348 to 2415)rr .Soeller,W., Abarzua,P. and Marians,K.J.ss xMutational analysis of primosome assembly sites. II. Role of secondary structure in the formation of active sitestu 2J. Biol. Chem. 259 (22), 14293-14300 (1984)vv R20 (bases 1 to 4361)xx $Van Dyke,M.M. and Dervan,P.B.yy 'Echinomycin binding sites on DNAzz +Science 225 (4667), 1122-1127 (1984){{ 21 (sites)}} 5Pouwels,P.H., Enger-Valk,B.E. and Brammar,W.J.~~ Vector I-A-iv-1 a(in) Brammar,W.J. (Ed.); CLONING VECTORS; Elsevier Scientific Publishing, Amsterdam (1985) O822 (bases 1 to 4361) Watson,N. 7A new revision of the sequence of plasmid pBR322 "Gene 70 (2), 399-403 (1988) 23 (sites) Gilbert,W. Obtained from VecBase 3.0 Unpublished (1991)-- Additional Annotations -- NID = -- End of Additional Annotations -- The circular sequence is numbered such that 0 is the middle of the unique EcoRI site and the count increases first through the tet genes, the pMB1 material, and finally through the Tn3 region. Plasmid pBR322 contains ampicillin and tetracycline resistance genes. The ampicillin resistance gene (amp-r) is a penicillin beta-lactamase. Promoters P1 and P3 are for the beta-lactamase gene. P3 is the natural promoter, and P1 is artificially created by the ligation of two different DNA fragments to create pBR322. P2 is in the same region as P1, but it is on the opposite strand and initiates transcription in the direction of the tetracycline resistance gene. Mutational studies in the primosome assembly sites indicate four types of mutations: Class I having no effect on the activities elicited by the DNA site and the bases involved are probably spacers; Class II requiring higher Mg-2+ concentrations than the wild-type to be fully activated as factor Y ATPase effectors; Class III co-inactivating both the ATPase effector and DNA replication template activity of the site, indicating that they probably represent essential contact points between factor Y and the DNA; Class IV having a replication template activity intermediate that of class III and class II mutant DNAs. Specific sites within or near the origins of replication are recognized by dnaA protein. Without dnaA binding to the origin of replication chromosomal replication is not possible [15]. pBR322 DNA contains two separate regions on opposite strands and close to the origin of replication which, when in single-stranded form, can act as effectors for the ATPase activity of E.coli replication factor Y [5]. Small fragments of DNA containing these sites when cloned in an f1 phage vector act as origins of DNA replication allowing the formation of complementary double-stranded DNA in rifampicin-resistant, dna[B,G,C]-dependent fashion in vitro [5]. The biological activity of echinomycin is thought to be related to the formation of complexes by intercalating with cellular DNA [20]. Complete source information: Plasmid pBR322 from E.coli [2],[1],[3],[6],[11],[8],[5],[7],[12], [13],[10],[9],[14],[18],[19],[15],[20],[16]; pBR322 DNA in pXf3 [4]. The following data and their annotation were supplied by Will Gilbert under the auspices of the Curator Program. CROSSREFERENCE #parent GenBank(50):pSC101C, GenBank(50):Trn3 #offspring VecBase(3):pBR325, VecBase(3):pBR327, VecBase(3):pBR328, VecBase(3):pAT153, VecBase(3):pUC7, VecBase(3):pJRD158, VecBase(3):PiVX, VecBase(3):PiAN7, VecBase(3):pSP64, VecBase(3):pSP65, VecBase(3):pGEM1, VecBase(3):pGEM2, VecBase(3):pGEM3, VecBase(3):pGEM4, VecBase(3):pKK223, VecBase(3):pLBU3, VecBase(3):pTrS3, VecBase(3):pRSVNeo, VecBase(3):pSV2Cat, VecBase(3):M13mp9, VecBase(3):pHC79, VecBase(3):pV34, VecBase(3):pKTH601, VecBase(3):pKTH604, VecBase(3):pKTH605, VecBase(3):pKTH606, VecBase(3):YEp24, VecBase(3):YIp5, VecBase(3):YRp17, VecBase(3):pSP18, VecBase(3):pSP19, VecBase(3):pSP6T3, VecBase(3):pSP6T719, VecBase(3):pT712, VecBase(3):pT713, VecBase(3):pT7T318, VecBase(3):pT7T319, VecBase(3):pT7T3A18, VecBase(3):pT7T3A19, VecBase(3):pEX1, VecBase(3):pEX2, VecBase(3):pEX3, VecBase(3):pCKSP6, VecBase(3):pACYC177, VecBase(3):pKO1, VecBase(3):pKO2, VecBase(3):pKM1, VecBase(3):pKM2, VecBase(3):pMBL1, VecBase(3):pMBL604, VecBase(3):pMC1511, VecBase(3):pMC1871, VecBase(3):pAA37X, VecBase(3):pUR278, VecBase(3):pUR288, VecBase(3):pUR289, VecBase(3):pUR290, VecBase(3):pUR291, VecBase(3):pUR292, VecBase(3):pUR222.1 983 A 1210 C 1134 G 1034 T 0 OTHEREcoRI site.%R64<ffff= geneva <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5  <ffff9 5  <H 5tetracycline resistance gene <ffff9 5  <ffff9 5  <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5 </ 5rop<ffff9 5 <ffff9 5 <ffff9 5 <ffff9 5  <ffff/ 5ori!<ffff9 5 "<ffff9 5 #<ffff9 5 $<ffff9 5 %<ffff9 5 &<ffff9 5 '<ffff9 5 (<ff? 5beta-lactamase gene)<ffff9 5 *<ffff9 5 +<ffff9 5 ,<ffff9 5 -<ffff9 5 .<ffff9 5 /<ffff9 5 0<ffff9 5 1<ffff9 5 2<ffff9 5 3<ffff9 5 4OE 5xn3"  helvetica]S 5H biococoa-2.2.2/Tests/Test-BCFoundation/DataFiles/pCDNA3.xdna000644 000765 000024 00000012666 10675026741 023772 0ustar00scottcstaff000000 000000 555FWFFl3GACGGATCGGGAGATCTCCCGATCCCCTATGGTCGACTCTCAGTACAATCTGCTCTGATGCCGCATAGTTAAGCCAGTATCTGCTCCCTGCTTGTGTGTTGGAGGTCGCTGAGTAGTGCGCGAGCAAAATTTAAGCTACAACAAGGCAAGGCTTGACCGACAATTGCATGAAGAATCTGCTTAGGGTTAGGCGTTTTGCGCTGCTTCGCGATGTACGGGCCAGATATACGCGTTGACATTGATTATTGACTAGTTATTAATAGTAATCAATTACGGGGTCATTAGTTCATAGCCCATATATGGAGTTCCGCGTTACATAACTTACGGTAAATGGCCCGCCTGGCTGACCGCCCAACGACCCCCGCCCATTGACGTCAATAATGACGTATGTTCCCATAGTAACGCCAATAGGGACTTTCCATTGACGTCAATGGGTGGACTATTTACGGTAAACTGCCCACTTGGCAGTACATCAAGTGTATCATATGCCAAGTACGCCCCCTATTGACGTCAATGACGGTAAATGGCCCGCCTGGCATTATGCCCAGTACATGACCTTATGGGACTTTCCTACTTGGCAGTACATCTACGTATTAGTCATCGCTATTACCATGGTGATGCGGTTTTGGCAGTACATCAATGGGCGTGGATAGCGGTTTGACTCACGGGGATTTCCAAGTCTCCACCCCATTGACGTCAATGGGAGTTTGTTTTGGCACCAAAATCAACGGGACTTTCCAAAATGTCGTAACAACTCCGCCCCATTGACGCAAATGGGCGGTAGGCGTGTACGGTGGGAGGTCTATATAAGCAGAGCTCTCTGGCTAACTAGAGAACCCACTGCTTACTGGCTTATCGAAATTAATACGACTCACTATAGGGAGACCCAAGCTTGGTACCGAGCTCGGATCCACTAGTAACGGCCGCCAGTGTGCTGGAATTCTGCAGATATCCATCACACTGGCGGCCGCTCGAGCATGCATCTAGAGGGCCCTATTCTATAGTGTCACCTAAATGCTAGAGCTCGCTGATCAGCCTCGACTGTGCCTTCTAGTTGCCAGCCATCTGTTGTTTGCCCCTCCCCCGTGCCTTCCTTGACCCTGGAAGGTGCCACTCCCACTGTCCTTTCCTAATAAAATGAGGAAATTGCATCGCATTGTCTGAGTAGGTGTCATTCTATTCTGGGGGGTGGGGTGGGGCAGGACAGCAAGGGGGAGGATTGGGAAGACAATAGCAGGCATGCTGGGGATGCGGTGGGCTCTATGGCTTCTGAGGCGGAAAGAACCAGCTGGGGCTCTAGGGGGTATCCCCACGCGCCCTGTAGCGGCGCATTAAGCGCGGCGGGTGTGGTGGTTACGCGCAGCGTGACCGCTACACTTGCCAGCGCCCTAGCGCCCGCTCCTTTCGCTTTCTTCCCTTCCTTTCTCGCCACGTTCGCCGGCTTTCCCCGTCAAGCTCTAAATCGGGGCATCCCTTTAGGGTTCCGATTTAGTGCTTTACGGCACCTCGACCCCAAAAAACTTGATTAGGGTGATGGTTCACGTAGTGGGCCATCGCCCTGATAGACGGTTTTTCGCCCTTTGACGTTGGAGTCCACGTTCTTTAATAGTGGACTCTTGTTCCAAACTGGAACAACACTCAACCCTATCTCGGTCTATTCTTTTGATTTATAAGGGATTTTGGGGATTTCGGCCTATTGGTTAAAAAATGAGCTGATTTAACAAAAATTTAACGCGAATTAATTCTGTGGAATGTGTGTCAGTTAGGGTGTGGAAAGTCCCCAGGCTCCCCAGGCAGGCAGAAGTATGCAAAGCATGCATCTCAATTAGTCAGCAACCAGGTGTGGAAAGTCCCCAGGCTCCCCAGCAGGCAGAAGTATGCAAAGCATGCATCTCAATTAGTCAGCAACCATAGTCCCGCCCCTAACTCCGCCCATCCCGCCCCTAACTCCGCCCAGTTCCGCCCATTCTCCGCCCCATGGCTGACTAATTTTTTTTATTTATGCAGAGGCCGAGGCCGCCTCTGCCTCTGAGCTATTCCAGAAGTAGTGAGGAGGCTTTTTTGGAGGCCTAGGCTTTTGCAAAAAGCTCCCGGGAGCTTGTATATCCATTTTCGGATCTGATCAAGAGACAGGATGAGGATCGTTTCGCATGATTGAACAAGATGGATTGCACGCAGGTTCTCCGGCCGCTTGGGTGGAGAGGCTATTCGGCTATGACTGGGCACAACAGACAATCGGCTGCTCTGATGCCGCCGTGTTCCGGCTGTCAGCGCAGGGGCGCCCGGTTCTTTTTGTCAAGACCGACCTGTCCGGTGCCCTGAATGAACTGCAGGACGAGGCAGCGCGGCTATCGTGGCTGGCCACGACGGGCGTTCCTTGCGCAGCTGTGCTCGACGTTGTCACTGAAGCGGGAAGGGACTGGCTGCTATTGGGCGAAGTGCCGGGGCAGGATCTCCTGTCATCTCACCTTGCTCCTGCCGAGAAAGTATCCATCATGGCTGATGCAATGCGGCGGCTGCATACGCTTGATCCGGCTACCTGCCCATTCGACCACCAAGCGAAACATCGCATCGAGCGAGCACGTACTCGGATGGAAGCCGGTCTTGTCGATCAGGATGATCTGGACGAAGAGCATCAGGGGCTCGCGCCAGCCGAACTGTTCGCCAGGCTCAAGGCGCGCATGCCCGACGGCGAGGATCTCGTCGTGACCCATGGCGATGCCTGCTTGCCGAATATCATGGTGGAAAATGGCCGCTTTTCTGGATTCATCGACTGTGGCCGGCTGGGTGTGGCGGACCGCTATCAGGACATAGCGTTGGCTACCCGTGATATTGCTGAAGAGCTTGGCGGCGAATGGGCTGACCGCTTCCTCGTGCTTTACGGTATCGCCGCTCCCGATTCGCAGCGCATCGCCTTCTATCGCCTTCTTGACGAGTTCTTCTGAGCGGGACTCTGGGGTTCGAAATGACCGACCAAGCGACGCCCAACCTGCCATCACGAGATTTCGATTCCACCGCCGCCTTCTATGAAAGGTTGGGCTTCGGAATCGTTTTCCGGGACGCCGGCTGGATGATCCTCCAGCGCGGGGATCTCATGCTGGAGTTCTTCGCCCACCCCAACTTGTTTATTGCAGCTTATAATGGTTACAAATAAAGCAATAGCATCACAAATTTCACAAATAAAGCATTTTTTTCACTGCATTCTAGTTGTGGTTTGTCCAAACTCATCAATGTATCTTATCATGTCTGTATACCGTCGACCTCTAGCTAGAGCTTGGCGTAATCATGGTCATAGCTGTTTCCTGTGTGAAATTGTTATCCGCTCACAATTCCACACAACATACGAGCCGGAAGCATAAAGTGTAAAGCCTGGGGTGCCTAATGAGTGAGCTAACTCACATTAATTGCGTTGCGCTCACTGCCCGCTTTCCAGTCGGGAAACCTGTCGTGCCAGCTGCATTAATGAATCGGCCAACGCGCGGGGAGAGGCGGTTTGCGTATTGGGCGCTCTTCCGCTTCCTCGCTCACTGACTCGCTGCGCTCGGTCGTTCGGCTGCGGCGAGCGGTATCAGCTCACTCAAAGGCGGTAATACGGTTATCCACAGAATCAGGGGATAACGCAGGAAAGAACATGTGAGCAAAAGGCCAGCAAAAGGCCAGGAACCGTAAAAAGGCCGCGTTGCTGGCGTTTTTCCATAGGCTCCGCCCCCCTGACGAGCATCACAAAAATCGACGCTCAAGTCAGAGGTGGCGAAACCCGACAGGACTATAAAGATACCAGGCGTTTCCCCCTGGAAGCTCCCTCGTGCGCTCTCCTGTTCCGACCCTGCCGCTTACCGGATACCTGTCCGCCTTTCTCCCTTCGGGAAGCGTGGCGCTTTCTCAATGCTCACGCTGTAGGTATCTCAGTTCGGTGTAGGTCGTTCGCTCCAAGCTGGGCTGTGTGCACGAACCCCCCGTTCAGCCCGACCGCTGCGCCTTATCCGGTAACTATCGTCTTGAGTCCAACCCGGTAAGACACGACTTATCGCCACTGGCAGCAGCCACTGGTAACAGGATTAGCAGAGCGAGGTATGTAGGCGGTGCTACAGAGTTCTTGAAGTGGTGGCCTAACTACGGCTACACTAGAAGGACAGTATTTGGTATCTGCGCTCTGCTGAAGCCAGTTACCTTCGGAAAAAGAGTTGGTAGCTCTTGATCCGGCAAACAAACCACCGCTGGTAGCGGTGGTTTTTTTGTTTGCAAGCAGCAGATTACGCGCAGAAAAAAAGGATCTCAAGAAGATCCTTTGATCTTTTCTACGGGGTCTGACGCTCAGTGGAACGAAAACTCACGTTAAGGGATTTTGGTCATGAGATTATCAAAAAGGATCTTCACCTAGATCCTTTTAAATTAAAAATGAAGTTTTAAATCAATCTAAAGTATATATGAGTAAACTTGGTCTGACAGTTACCAATGCTTAATCAGTGAGGCACCTATCTCAGCGATCTGTCTATTTCGTTCATCCATAGTTGCCTGACTCCCCGTCGTGTAGATAACTACGATACGGGAGGGCTTACCATCTGGCCCCAGTGCTGCAATGATACCGCGAGACCCACGCTCACCGGCTCCAGATTTATCAGCAATAAACCAGCCAGCCGGAAGGGCCGAGCGCAGAAGTGGTCCTGCAACTTTATCCGCCTCCATCCAGTCTATTAATTGTTGCCGGGAAGCTAGAGTAAGTAGTTCGCCAGTTAATAGTTTGCGCAACGTTGTTGCCATTGCTACAGGCATCGTGGTGTCACGCTCGTCGTTTGGTATGGCTTCATTCAGCTCCGGTTCCCAACGATCAAGGCGAGTTACATGATCCCCCATGTTGTGCAAAAAAGCGGTTAGCTCCTTCGGTCCTCCGATCGTTGTCAGAAGTAAGTTGGCCGCAGTGTTATCACTCATGGTTATGGCAGCACTGCATAATTCTCTTACTGTCATGCCATCCGTAAGATGCTTTTCTGTGACTGGTGAGTACTCAACCAAGTCATTCTGAGAATAGTGTATGCGGCGACCGAGTTGCTCTTGCCCGGCGTCAATACGGGATAATACCGCGCCACATAGCAGAACTTTAAAAGTGCTCATCATTGGAAAACGTTCTTCGGGGCGAAAACTCTCAAGGATCTTACCGCTGTTGAGATCCAGTTCGATGTAACCCACTCGTGCACCCAACTGATCTTCAGCATCTTTTACTTTCACCAGCGTTTCTGGGTGAGCAAAAACAGGAAGGCAAAATGCCGCAAAAAAGGGAATAAGGGCGACACGGAAATGTTGAATACTCATACTCTTCCTTTTTCAATATTATTGAAGCATTTATCAGGGTTATTGTCTCATGAGCGGATACATATTTGAATGTATTTAGAAAAATAAACAAATAGGGGTTCCGCGCACATTTCCCCGAAAAGTGCCACCTGACGTCbiococoa-2.2.2/Tests/Test-BCFoundation/DataFiles/pvL1392-SFhB26H000755 000765 000024 00000033355 10675026741 024212 0ustar00scottcstaff000000 000000 0**AGCTTTACTCGTAAAGCGAGTTGAAGGATCATATTTAGTTGCGTTTATGAGATAAGATTGAAAGCACGTGTAAAATGTTTCCCGCGCGTTGGCACAACTATTTACAATGCGGCCAAGTTATAAAAGATTCTAATCTGATATGTTTTAAAACACCTTTGCGGCCCGAGTTGTTTGCGTACGTGACTAGCGAAGAAGATGTGTGGACCGCAGAACAGATAGTAAAACAAAACCCTAGTATTGGAGCAATAATCGATTTAACCAACACGTCTAAATATTATGATGGTGTGCATTTTTTGCGGGCGGGCCTGTTATACAAAAAAATTCAAGTACCTGGCCAGACTTTGCCGCCTGAAAGCATAGTTCAAGAATTTATTGACACGGTAAAAGAATTTACAGAAAAGTGTCCCGGCATGTTGGTGGGCGTGCACTGCACACACGGTATTAATCGCACCGGTTACATGGTGTGCAGATATTTAATGCACACCCTGGGTATTGCGCCGCAGGAAGCCATAGATAGATTCGAAAAAGCCAGAGGTCACAAAATTGAAAGACAAAATTACGTTCAAGATTTATTAATTTAATTAATATTATTTGCATTCTTTAACAAATACTTTATCCTATTTTCAAATTGTTGCGCTTCTTCCAGCGAACCAAAACTATGCTTCGCTTGCTCCGTTTAGCTTGTAGCCGATCAGTGGCGTTGTTCCAATCGACGGTAGGATTAGGCCGGATATTCTCCACCACAATGTTGGCAACGTTGATGTTACGTTTATGCTTTTGGTTTTCCACGTACGTCTTTTGGCCGGTAATAGCCGTAAACGTAGTGCCGTCGCGCGTCACGCACAACACCGGATGTTTGCGCTTGTCCGCGGGGTATTGAACCGCGCGATCCGACAAATCCACCACTTTGGCAACTAAATCGGTGACCTGCGCGTCTTTTTTCTGCATTATTTCGTCTTTCTTTTGCATGGTTTCCTGGAAGCCGGTGTACATGCGGTTTAGATCAGTCATGACGCGCGTGACCTGCAAATCTTTGGCCTCGATCTGCTTGTCCTTGATGGCAACGATGCGTTCAATAAACTCTTGTTTTTTAACAAGTTCCTCGGTTTTTTGCGCCACCACCGCTTGCAGCGCGTTTGTGTGCTCGGTGAATGTCGCAATCAGCTTAGTCACCAACTGTTTGCTCTCCTCCTCCCGTTGTTTGATCGCGGGATCGTACTTGCCGGTGCAGAGCACTTGAGGAATTACTTCTTCTAAAAGCCATTCTTGTAATTCTATGGCGTAAGGCAATTTGGACTTCATAATCAGCTGAATCACGCCGGATTTAGTAATGAGCACTGTATGCGGCTGCAAATACAGCGGGTCGCCCCTTTTCACGACGCTGTTAGAGGTAGGGCCCCCATTTTGGATGGTCTGCTCAAATAACGATTTGTATTTATTGTCTACATGAACACGTATAGCTTTATCACAAACTGTATATTTTAAACTGTTAGCGACGTCCTTGGCCACGAACCGGACCTGTTGGTCGCGCTCTAGCACGTACCGCAGGTTGAACGTATCTTCTCCAAATTTAAATTCTCCAATTTTAACGCGAGCCATTTTGATACACGTGTGTCGATTTTGCAACAACTATTGTTTTTTAACGCAAACTAAACTTATTGTGGTAAGCAATAATTAAATATGGGGGAACATGCGCCGCTACAACACTCGTCGTTATGAACGCAGACGGCGCCGGTCTCGGCGCAAGCGGCTAAAACGTGTTGCGCGTTCAACGCGGCAAACATCGCAAAAGCCAATAGTACAGTTTTGATTTGCATATTAACGGCGATTTTTTAAATTATCTTATTTAATAAATAGTTATGACGCCTACAACTCCCCGCCCGCGTTGACTCGCTGCACCTCGAGCAGTTCGTTGACGCCTTCCTCCGTGTGGCCGAACACGTCGAGCGGGTGGTCGATGACCAGCGGCGTGCCGCACGCGACGCACAAGTATCTGTACACCGAATGATCGTCGGGCGAAGGCACGTCGGCCTCCAAGTGGCAATATTGGCAAATTCGAAAATATATACAGTTGGGTTGTTTGCGCATATCTATCGTGGCGTTGGGCATGTACGTCCGAACGTTGATTTGCATGCAAGCCGAAATTAAATCATTGCGATTAGTGCGATTAAAACGTTGTACATCCTCGCTTTTAATCATGCCGTCGATTAAATCGCGCAATCGAGTCAAGTGATCAAAGTGTGGAATAATGTTTTCTTTGTATTCCCGAGTCAAGCGCAGCGCGTATTTTAACAAACTAGCCATCTTGTAAGTTAGTTTCATTTAATGCAACTTTATCCAATAATATATTATGTATCGCACGTCAAGAATTAACAATGCGCCCGTTGTCGCATCTCAACACGACTATGATAGAGATCAAATAAAGCGCGAATTAAATAGCTTGCGACGCAACGTGCACGATCTGTGCACGCGTTCCGGCACGAGCTTTGATTGTAATAAGTTTTTACGAAGCGATGACATGACCCCCGTAGTGACAACGATCACGCCCAAAAGAACTGCCGACTACAAAATTACCGAGTATGTCGGTGACGTTAAAACTATTAAGCCATCCAATCGACCGTTAGTCGAATCAGGACCGCTGGTGCGAGAAGCCGCGAAGTATGGCGAATGCATCGTATAACGTGTGGAGTCCGCTCATTAGAGCGTCATGTTTAGACAAGAAAGCTACATATTTAATTGATCCCGATGATTTTATTGATAAATTGACCCTAACTCCATACACGGTATTCTACAATGGCGGGGTTTTGGTCAAAATTTCCGGACTGCGATTGTACATGCTGTTAACGGCTCCGCCCACTATTAATGAAATTAAAAATTCCAATTTTAAAAAACGCAGCAAGAGAAACATTTGTATGAAAGAATGCGTAGAAGGAAAGAAAAATGTCGTCGACATGCTGAACAACAAGATTAATATGCCTCCGTGTATAAAAAAAATATTGAACGATTTGAAAGAAAACAATGTACCGCGCGGCGGTATGTACAGGAAGAGGTTTATACTAAACTGTTACATTGCAAACGTGGTTTCGTGTGCCAAGTGTGAAAACCGATGTTTAATCAAGGCTCTGACGCATTTCTACAACCACGACTCCAAGTGTGTGGGTGAAGTCATGCATCTTTTAATCAAATCCCAAGATGTGTATAAACCACCAAACTGCCAAAAAATGAAAACTGTCGACAAGCTCTGTCCGTTTGCTGGCAACTGCAAGGGTCTCAATCCTATTTGTAATTATTGAATAATAAAACAATTATAAATGCTAAATTTGTTTTTTATTAACGATACAAACCAAACGCAACAAGAACATTTGTAGTATTATCTATAATTGAAAACGCGTAGTTATAATCGCTGAGGTAATATTTAAAATCATTTTCAAATGATTCACAGTTAATTTGCGACAATATAATTTTATTTTCACATAAACTAGACGCCTTGTCGTCTTCTTCTTCGTATTCCTTCTCTTTTTCATTTTTCTCCTCATAAAAATTAACATAGTTATTATCGTATCCATATATGTATCTATCGTATAGAGTAAATTTTTTGTTGTCATAAATATATATGTCTTTTTTAATGGGGTGTATAGTACCGCTGCGCATAGTTTTTCTGTAATTTACAACAGTGCTATTTTCTGGTAGTTCTTCGGAGTGTGTTGCTTTAATTATTAAATTTATATAATCAATGAATTTGGGATCGTCGGTTTTGTACAATATGTTGCCGGCATAGTACGCAGCTTCTTCTAGTTCAATTACACCATTTTTTAGCAGCACCGGATTAACATAACTTTCCAAAATGTTGTACGAACCGTTAAACAAAAACAGTTCACCTCCCTTTTCTATACTATTGTCTGCGAGCAGTTGTTTGTTGTTAAAAATAACAGCCATTGTAATGAGACGCACAAACTAATATCACAAACTGGAAATGTCTATCAATATATAGTTGCTGATATCATGGAGATAATTAAAATGATAACCATCTCGCAAATAAATAAGTATTTTACTGTTTTCGTAACAGTTTTGTAATAAAAAAACCTATAAATATTCCGGATTATTCATACCGTCCCACCATCGGGCGCGGATCAGATCTGCAGCGGCCGCTCCAGAATTCgagctcgccccgcccccagccagtgcgcttacctgccagactgcgcgccATGAAGACGATCATCGCCCTGAGCTACATCTTCTGCCTGGTGTTCGCCGACTACAAGGACGATGATGACGCCATGGGGCAACCCGGGAACGGCAGCGCCTTCTTGCTGGCACCCAATAGAAGCCATGCGCCGGACCACGACGTCACGCAGCAAAGGGACGAGGTGTGGGTGGTGGGCATGGGCATCGTCATGTCTCTCATCGTCCTGGCCATCGTGTTTGGCAATGTGCTGGTCATCACAGCCATTGCCAAGTTCGAGCGTCTGCAGACGGTCACCAACTACTTCATCACTTCACTGGCCTGTGCTGATCTGGTCATGGGCCTGGCAGTGGTGCCCTTTGGGGCCGCCCATATTCTTATGAAAATGTGGACTTTTGGCAACTTCTGGTGCGAGTTTTGGACTTCCATTGATGTGCTGTGCGTCACGGCCAGCATTGAGACCCTGTGCGTGATCGCAGTGGATCGCTACTTTGCCATTACTTCACCTTTCAAGTACCAGAGCCTGCTGACCAAGAATAAGGCCCGGGTGATCATTCTGATGGTGTGGATTGTGTCAGGCCTTACCTCCTTCTTGCCCATTCAGATGCACTGGTACCGGGCCACCCACCAGGAAGCCATCAACTGCTATGCCAATGAGACCTGCTGTGACTTCTTCACGAACCAAGCCTATGCCATTGCCTCTTCCATCGTGTCCTTCTACGTTCCCCTGGTGATCATGGTCTTCGTCTACTCCAGGGTCTTTCAGGAGGCCAAAAGGCAGCTCCAGAAGATTGACAAATCTGAGGGCCGCTTCCATGTCCAGAACCTTAGCCAGGTGGAGCAGGATGGGCGGACGGGGCATGGACTCCGCAGATCTTCCAAGTTCTGCTTGAAGGAGCACAAAGCCCTCAAGACGTTAGGCATCATCATGGGCACTTTCACCCTCTGCTGGCTGCCCTTCTTCATCGTTAACATTGTGCATGTGATCCAGGATAACCTCATCCGTAAGGAAGTTTACATCCTCCTAAATTGGATAGGCTATGTCAATTCTGGTTTCAATCCCCTTATCTACTGCCGGAGCCCAGATTTCAGGATTGCCTTCCAGGAGCTTCTGTGCCTGCGCAGGTCTTCTTTGAAGGCCTATGGGAATGGCTACTCCAGCAACGGCAACACAGGGGAGCAGAGTGGATATCACGTGGAACAGGAGAAAGAAAATAAACTGCTGTGTGAAGACCTCCCAGGCACGGAAGACTTTGTGGGCCATCAAGGTACTGTGCCTAGCGATAACATTGATTCACAAGGGAGGAATTGTAGTACAAATGACTCACTGCTGCACCATCATCACCATCACTAGgatccTTTCCTGGGACCCGGCAAGAACCAAAAACTCACTCTCTTCAAGGAAATCCGTAATGTTAAACCCGACACGATGAAGCTTGTCGTTGGATGGAAAGGAAAAGAGTTCTACAGGGAAACTTGGACCCGCTTCATGGAAGACAGCTTCCCCATTGTTAACGACCAAGAAGTGATGGATGTTTTCCTTGTTGTCAACATGCGTCCCACTAGACCCAACCGTTGTTACAAATTCCTGGCCCAACACGCTCTGCGTTGCGACCCCGACTATGTACCTCATGACGTGATTAGGATCGTCGAGCCTTCATGGGTGGGCAGCAACAACGAGTACCGCATCAGCCTGGCTAAGAAGGGCGGCGGCTGCCCAATAATGAACCTTCACTCTGAGTACACCAACTCGTTCGAACAGTTCATCGATCGTGTCATCTGGGAGAACTTCTACAAGCCCATCGTTTACATCGGTACCGACTCTGCTGAAGAGGAGGAAATTCTCCTTGAAGTTTCCCTGGTGTTCAAAGTAAAGGAGTTTGCACCAGACGCACCTCTGTTCACTGGTCCGGCGTATTAAAACACGATACATTGTTATTAGTACATTTATTAAGCGCTAGATTCTGTGCGTTGTTGATTTACAGACAATTGTTGTACGTATTTTAATAATTCATTAAATTTATAATCTTTAGGGTGGTATGTTAGAGCGAAAATCAAATGATTTTCAGCGTCTTTATATCTGAATTTAAATATTAAATCCTCAATAGATTTGTAAAATAGGTTTCGATTAGTTTCAAACAAGGGTTGTTTTTCCGAACCGATGGCTGGACTATCTAATGGATTTTCGCTCAACGCCACAAAACTTGCCAAATCTTGTAGCAGCAATCTAGCTTTGTCGATATTCGTTTGTGTTTTGTTTTGTAATAAAGGTTCGACGTCGTTCAAAATATTATGCGCTTTTGTATTTCTTTCATCACTGTCGTTAGTGTACAATTGACTCGACGTAAACACGTTAAATAAAGCTTGGACATATTTAACATCGGGCGTGTTAGCTTTATTAGGCCGATTATCGTCGTCGTCCCAACCCTCGTCGTTAGAAGTTGCTTCCGAAGACGATTTTGCCATAGCCACACGACGCCTATTAATTGTGTCGGCTAACACGTCCGCGATCAAATTTGTAGTTGAGCTTTTTGGAATTATTTCTGATTGCGGGCGTTTTTGGGCGGGTTTCAATCTAACTGTGCCCGATTTTAATTCAGACAACACGTTAGAAAGCGATGGTGCAGGCGGTGGTAACATTTCAGACGGCAAATCTACTAATGGCGGCGGTGGTGGAGCTGATGATAAATCTACCATCGGTGGAGGCGCAGGCGGGGCTGGCGGCGGAGGCGGAGGCGGAGGTGGTGGCGGTGATGCAGACGGCGGTTTAGGCTCAAATGTCTCTTTAGGCAACACAGTCGGCACCTCAACTATTGTACTGGTTTCGGGCGCCGTTTTTGGTTTGACCGGTCTGAGACGAGTGCGATTTTTTTCGTTTCTAATAGCTTCCAACAATTGTTGTCTGTCGTCTAAAGGTGCAGCGGGTTGAGGTTCCGTCGGCATTGGTGGAGCGGGCGGCAATTCAGACATCGATGGTGGTGGTGGTGGTGGAGGCGCTGGAATGTTAGGCACGGGAGAAGGTGGTGGCGGCGGTGCCGCCGGTATAATTTGTTCTGGTTTAGTTTGTTCGCGCACGATTGTGGGCACCGGCGCAGGCGCCGCTGGCTGCACAACGGAAGGTCGTCTGCTTCGAGGCAGCGCTTGGGGTGGTGGCAATTCAATATTATAATTGGAATACAAATCGTAAAAATCTGCTATAAGCATTGTAATTTCGCTATCGTTTACCGTGCCGATATTTAACAACCGCTCAATGTAAGCAATTGTATTGTAAAGAGATTGTCTCAAGCTCGCCGCACGCCGATAACAAGCCTTTTCATTTTTACTACAGCATTGTAGTGGCGAGACACTTCGCTGTCGTCGACGTACATGTATGCTTTGTTGTCAAAAACGTCGTTGGCAAGCTTTAAAATATTTAAAAGAACATCTCTGTTCAGCACCACTGTGTTGTCGTAAATGTTGTTTTTGATAATTTGCGCTTCCGCAGTATCGACACGTTCAAAAAATTGATGCGCATCAATTTTGTTGTTCCTATTATTGAATAAATAAGATTGTACAGATTCATATCTACGATTCGTCATGGCCACCACAAATGCTACGCTGCAAACGCTGGTACAATTTTACGAAAACTGCAAAAACGTCAAAACTCGGTATAAAATAATCAACGGGCGCTTTGGCAAAATATCTATTTTATCGCACAAGCCCACTAGCAAATTGTATTTGCAGAAAACAATTTCGGCGCACAATTTTAACGCTGACGAAATAAAAGTTCACCAGTTAATGAGCGACCACCCAAATTTTATAAAAATCTATTTTAATCACGGTTCCATCAACAACCAAGTGATCGTGATGGACTACATTGACTGTCCCGATTTATTTGAAACACTACAAATTAAAGGCGAGCTTTCGTACCAACTTGTTAGCAATATTATTAGACAGCTGTGTGAAGCGCTCAACGATTTGCACAAGCACAATTTCATACACAACGACATAAAACTCGAAAATGTCTTATATTTCGAAGCACTTGATCGCGTGTATGTTTGCGATTACGGATTGTGCAAACACGAAAACTCACTTAGCGTGCACGACGGCACGTTGGAGTATTTTAGTCCGGAAAAAATTCGACACACAACTATGCACGTTTCGTTTGACTGGTACGCGGCGTGTTAACATACAAGTTGCTAACGTAATCATGGTCATAGCTGTTTCCTGTGTGAAATTGTTATCCGCTCACAATTCCACACAACATACGAGCCGGAAGCATAAAGTGTAAAGCCTGGGGTGCCTAATGAGTGAGCTAACTCACATTAATTGCGTTGCGCTCACTGCCCGCTTTCCAGTCGGGAAACCTGTCGTGCCAGCTGCATTAATGAATCGGCCAACGCGCGGGGAGAGGCGGTTTGCGTATTGGGCGCTCTTCCGCTTCCTCGCTCACTGACTCGCTGCGCTCGGTCGTTCGGCTGCGGCGAGCGGTATCAGCTCACTCAAAGGCGGTAATACGGTTATCCACAGAATCAGGGGATAACGCAGGAAAGAACATGTGAGCAAAAGGCCAGCAAAAGGCCAGGAACCGTAAAAAGGCCGCGTTGCTGGCGTTTTTCCATAGGCTCCGCCCCCCTGACGAGCATCACAAAAATCGACGCTCAAGTCAGAGGTGGCGAAACCCGACAGGACTATAAAGATACCAGGCGTTTCCCCCTGGAAGCTCCCTCGTGCGCTCTCCTGTTCCGACCCTGCCGCTTACCGGATACCTGTCCGCCTTTCTCCCTTCGGGAAGCGTGGCGCTTTCTCATAGCTCACGCTGTAGGTATCTCAGTTCGGTGTAGGTCGTTCGCTCCAAGCTGGGCTGTGTGCACGAACCCCCCGTTCAGCCCGACCGCTGCGCCTTATCCGGTAACTATCGTCTTGAGTCCAACCCGGTAAGACACGACTTATCGCCACTGGCAGCAGCCACTGGTAACAGGATTAGCAGAGCGAGGTATGTAGGCGGTGCTACAGAGTTCTTGAAGTGGTGGCCTAACTACGGCTACACTAGAAGGACAGTATTTGGTATCTGCGCTCTGCTGAAGCCAGTTACCTTCGGAAAAAGAGTTGGTAGCTCTTGATCCGGCAAACAAACCACCGCTGGTAGCGGTGGTTTTTTTGTTTGCAAGCAGCAGATTACGCGCAGAAAAAAAGGATCTCAAGAAGATCCTTTGATCTTTTCTACGGGGTCTGACGCTCAGTGGAACGAAAACTCACGTTAAGGGATTTTGGTCATGAGATTATCAAAAAGGATCTTCACCTAGATCCTTTTAAATTAAAAATGAAGTTTTAAATCAATCTAAAGTATATATGAGTAAACTTGGTCTGACAGTTACCAATGCTTAATCAGTGAGGCACCTATCTCAGCGATCTGTCTATTTCGTTCATCCATAGTTGCCTGACTCCCCGTCGTGTAGATAACTACGATACGGGAGGGCTTACCATCTGGCCCCAGTGCTGCAATGATACCGCGAGACCCACGCTCACCGGCTCCAGATTTATCAGCAATAAACCAGCCAGCCGGAAGGGCCGAGCGCAGAAGTGGTCCTGCAACTTTATCCGCCTCCATCCAGTCTATTAATTGTTGCCGGGAAGCTAGAGTAAGTAGTTCGCCAGTTAATAGTTTGCGCAACGTTGTTGCCATTGCTACAGGCATCGTGGTGTCACGCTCGTCGTTTGGTATGGCTTCATTCAGCTCCGGTTCCCAACGATCAAGGCGAGTTACATGATCCCCCATGTTGTGCAAAAAAGCGGTTAGCTCCTTCGGTCCTCCGATCGTTGTCAGAAGTAAGTTGGCCGCAGTGTTATCACTCATGGTTATGGCAGCACTGCATAATTCTCTTACTGTCATGCCATCCGTAAGATGCTTTTCTGTGACTGGTGAGTACTCAACCAAGTCATTCTGAGAATAGTGTATGCGGCGACCGAGTTGCTCTTGCCCGGCGTCAATACGGGATAATACCGCGCCACATAGCAGAACTTTAAAAGTGCTCATCATTGGAAAACGTTCTTCGGGGCGAAAACTCTCAAGGATCTTACCGCTGTTGAGATCCAGTTCGATGTAACCCACTCGTGCACCCAACTGATCTTCAGCATCTTTTACTTTCACCAGCGTTTCTGGGTGAGCAAAAACAGGAAGGCAAAATGCCGCAAAAAAGGGAATAAGGGCGACACGGAAATGTTGAATACTCATACTCTTCCTTTTTCAATATTATTGAAGCATTTATCAGGGTTATTGTCTCATGAGCGGATACATATTTGAATGTATTTAGAAAAATAAACAAATAGGGGTTCCGCGCACATTTCCCCGAAAAGTGCCACCTGACGTCTAAGAAACCATTATTATCATGACATTAACCTATAAAAATAGGCGTATCACGAGGCCCTTTCGTCTCGCGCGTTTCGGTGATGACGGTGAAAACCTCTGACACATGCAGCTCCCGGAGACGGTCACAGCTTGTCTGTAAGCGGATGCCGGGAGCAGACAAGCCCGTCAGGGCGCGTCAGCGGGTGTTGGCGGGTGTCGGGGCTGGCTTAACTATGCGGCATCAGAGCAGATTGTACTGAGAGTGCACCATATGCGGTGTGAAATACCGCACAGATGCGTAAGGAGAAAATACCGCATCAGGCGCCATTCGCCATTCAGGCTGCGCAACTGTTGGGAAGGGCGATCGGTGCGGGCCTCTTCGCTATTACGCCAGCTGGCGAAAGGGGGATGTGCTGCAAGGCGATTAAGTTGGGTAACGCCAGGGTTTTCCCAGTCACGACGTTGTAAAACGACGGCCAGTGCC* ? UUUU?pP UUUUjpP UUUUjP UUUUjP kUUUUjP UUUUjP kUUUUjP UUUUj* UUUU*p $lCM < )|P 9 6   *tK SFhB26HpvL1392-SFHB26H*$*V P )d ( )7M8T9?V  $d  ( )8 TV  $p ( )44V  (4 ( )44V  *T ( )44ouV P )|սd ( )8TBglIIEcoRINcoIKpnIBamHIKpnI**First Generation'dp 'm% '.P 'd0 % & & 'd$*X P )d ( )7M8T9?X P )P  K/ K K KHWf Kp KP KV [ K??h@ K K%^@ K% K@[ K0 K??h@ K%^@ K% K@ Kp8 K@8W K K K K KHWf Kp8" L KV L KV K $T K KBH$ Kp $T K  K@ [ KPֱ KV K pvL1392-SFHB26H  Standard Codon Table@ K Y KXQ K KQ KWf q K@ Kʰ 0  K@ KS  K$??h@ K K%^@ 0 % K K K@ K8 K@8 Kt K     *TUUUUP   (6   ( )@ *t?vf lnHH  p1046.99 K z ?G*` K ` ? K8 `( K@G*` KB(G*` Kpp K: & ( KS5`Wp KV K $TWf K S5` ? KV ` KPW$ KV K $TWf K`B(|:p*8sequbiococoa-2.2.2/Tests/Test-BCFoundation/DataFiles/test.fa000644 000765 000024 00000001200 10675026741 023413 0ustar00scottcstaff000000 000000 >seq GACGGAGATTGGCCCTCGAGTGCAAAGGCAGAANNNNNNGGGAGCTTGACTGCAAGACCCACCCGTCGAGCAGGGACG AAAGTCGGCCTTAGTGATCCGACGGTGCCGAGTGGAAGGGCCGTCGCTCAACGGATAAAAGTTACTCTAGGGATAACA GGCTGATCTTCCCCAAGAGCTCACATCGACGGGAAGGTTTGGCACCTCGATGTCGGCTCTTCGCCACCTGGGGCTGTA GTATGTTCCAAGGGTTGGGNNNNNNNNCTGTTCGCCCATTAAAGCGGTACGTGAGCTGGGTTCAGAACGTCGTGAGAC AGTTCGGTCCATATCCGGTGTGGGCGTTAGAGCATTGAGAGGACCTTTCCCTAGTAaaaaaaaaaCGAGAGGACCGGG AAGGACGCACCTCTGGTGTACCAGTTATCGTGCCCACGGTAAACGCTGGGTAGCCAAGTGCGGAGCGGATAACTGCTG AAAGCATCTAAGTAGTAAGCCCACCCCAAGATGAGTGCTCTCCTATTCC >seq1 TTTACCGTGGGCACGATAACTGGTACACCAGAGGTGCGTCCTTCCCGGTCC GTGCGGAGCGGATAACTGCTGAAAGCATCTAAGTAGTAAGCCCACCCCAAG biococoa-2.2.2/Tests/Test-BCFoundation/DataFiles/test.fastq000644 000765 000024 00000005012 11075474223 024145 0ustar00scottcstaff000000 000000 @SRR001472.168871 E8YF17F04J2CYT length=157 AGGCGTATGCCACCAAGCCCAGCTAATTTTTGTATTTTTAGTTACAGATGGGGTTTCCCGGATGTTGACCAGGCTAGTCTCTAACTCCTGACCTCAAGTGATCCACCTGCCTCAGCCTCCCAAAGTGTTGGTTGGAACCGAAAGGGTTTGAATTCAA +SRR001472.168871 E8YF17F04J2CYT length=157 DDDDDDDDDDDDDDDDDDDDBDEE??/////8,?/////88,,8?BBBBBB::555???006?DBBBBDDDDDDDDDDDDDDBBBDDDDDDDDDDDDDDDDDDBBBBBDDDDDDDDDDDDDDBBBDDDDDDDDDD>>><<<<<<>> @SRR001472.168872 E8YF17F04J19OT length=250 CTGAGCTGGGATGAAGACTGTAAGTCCCACCACAGTCTGAGACCTAAAGGCCAAGCCCTAAGCCTGGTTAGAGAAATGATTCCTGACCCTACAAGACTAAATCAAAATCCTAGCTCATATTATCAGATCTAACAACAGGCTGAGACTAAGTACTCACCTTTGTCACATATCAAGTCTTAAACCCATAAACAAAGTTCACTGTATTAGTGGCCACAAACTGAGTCCTAGCACTAGCTGGAGGTTGAGCAAT +SRR001472.168872 E8YF17F04J19OT length=250 DDDDDDB;;;BDDDDDBBBDDDDDD;;;DDDDDD@@@EEEDDEEEDDDDDDDDDDDDB;;;BDDDDD@@@DDD@@@BDDDDDDDDDDDDDDDDDDB@988@BB5555BD@@@@BDDDDDBBBDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDB>8855555DDDDDDDDDDDDB<<<<<<5544:?:::AAACCC@@@CCCC@??::::?A:7111 @SRR001472.168874 E8YF17F04J1GJ3 length=62 AGCATTCCTTTTATTCACAACCTTGCCAGCATCTGTTGGAACCGAAAGGGTTTGAATTCAAA +SRR001472.168874 E8YF17F04J1GJ3 length=62 DDDDBBABBBBBDDDDB999DDDDDDDDDDDDDDDDDCCCCCCBA2233333>=>>>>>@CC @SRR001472.168875 E8YF17F04I1OI6 length=117 ATATATAATAAACCATTTCTTTTCTTTTCCTTTCTTTTCTTTTTAATATAGGATCTTGTTGGAACCGAAAGGGTTTGAATTCAAACCCTTTCGGTTCCACAAAAAAAAGAAGATCTG +SRR001472.168875 E8YF17F04I1OI6 length=117 DDDDDDDDB550>>@111?0000?....AA...>00008.....557BDDBDDDDDDDDDDDBBBBB>>>DDDDDDDDD866??DD>>6115?DDD>>?>55555555>,,=BDDDD @SRR001472.168876 E8YF17F04JSVMZ length=77 GTTAACATTTTCTCAGCTTTATGTGTTGAGTGATTTTGGATTCTATCCTGAAATGGTAAGAATGAAAAGAAAATCTG +SRR001472.168876 E8YF17F04JSVMZ length=77 FFFFFEE;777AFFFGG99;BEHFFEEEFHHEE;;;;BBFFHHIHFFFFFFFFFFFFFFFFFCA3333:1111ACFF @SRR001472.168879 E8YF17F04J2WWA length=78 ACACACAGCTCAAAGCGGAGCAGGACAGAACTGCTGTCTCATTTGAATATCTCTCTGGGGTTGGAACCGAAAGGGTTT +SRR001472.168879 E8YF17F04J2WWA length=78 DDDDDDDDDDDDBBBDDDEFFFEEFFFFFEEEEEEEDEDDDDDDDDDDDDBDDB>>500055==BB55658BBBDDDD @SRR001472.168880 E8YF17F04J0V15 length=218 TTGAATTCAAACCCTTTCGGTTCCAACTCAATTCTGTGACTTGAATGCAATCATCACAAAGAACTTTCTGAGAATGCTGCTGACTGCTTTTTATATGTAATCCCGTTTCCAACGAAATCCTCAAATCTAGCCCAATATCCACTTGCAGATTCCACAAAAAGAGTGTTTCAAAACTGTTCTGTCTAAAGAAATGTACAACTGTGTTAGTTGAGGACACA +SRR001472.168880 E8YF17F04J0V15 length=218 FFFFFFFFFFFFFFFFFFGGGGGGIIIIIIIIIIIIIIIIIIIIIFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEB;;777ACFFCCA@8999A@FF==@@DEEEEBBBFFFFFEEEFFFFFEEEEFFEEEFFFFFFFFFFFEB;;;;;BBEFFFFFEEEFGEEEFFFFFFFFFFFF===FFFFFFFFFFFFFFFFFFFFFFFFFGG biococoa-2.2.2/Tests/Test-BCFoundation/DataFiles/transposon.clustalw000644 000765 000024 00000147472 10675026741 026140 0ustar00scottcstaff000000 000000 CLUSTAL W (1.83) multiple sequence alignment AgaPB6 -------------------------------MNTHTDFDTHMDLETLTDLDTHTDIYSDT AgaPB7 -------------------------------MDTNTEIHPALS----------SNMETDS AgaPB8 ----------------------MFEANMPKLIEAQSGDEEDIRIPKKNTRNRIVSSDSES AgaPBD2 ----------------------------------MADNLNNIPNCFPNNEDSSSDSDHDA BmoPB1 ------------------------------------------------------------ HsaPGBD4 -----------------------------MSNPRKRSIPMRDSNTGLEQLLAEDSFDESD CinPB3 ---------------------------------------MFSATAAAEILMDAGSDLSDL CinPB4 ---------------------------------------LFFATAATEILLDAGSDLRDZ Pigibaku4 -------------------------------------MVVCLYVLALRLT---GVQSRVY TruPGBD1 --------------------------------------MRATSVYATRVR---GPRARNV CinPB2 -------------------------------------MMQLQLILSGDVS---DVEDIGS HsaPGBD1 ---------------------ECAPQIPCSTPIATERTVAHLNTLKDRHP-GDLWARMHI Mmupgbd1p ------------------------------SPSPTEKAVSTLNTVGSCHPPHDSWAKMHI HsaPGBD2 ---------------MASTSRDVIAGRGIHSKVKSAKLLEVLNAMEEEES-NNNREEIFI Mmupgbd2P ---------------------AVPARRGAHWTVRSPKLLQVLTALEEGEF-GSNREEISL HsaPGBD3 -------------------------------MPRTLSLHEITDLLETDDS--IEASAIVI HsaPGBD3P3 -------------------------------MPZTLSLHEITDLLETNDS--IDSSAVVI HsaPGBD3P2 -------------------------------MSQTLSLHEITX-LNTDDS--IEASTILI HsaPGBD3P1 -------------------------------MPQTLSLHEITDLLETDDI--IEASARVI HsaPGBD3P4 -------------------------------MLQTLNLHETIDLLKTDN-----SSAIVT HsaPGBD5 ------------------------MPDYRTRALFVQSTLGDSAGPELQLLSIVPGRDLQP Mmupgbd5 ------------------------------------------------------------ TruPGBD5 ------------------------------------------------------------ CinPB1 ----------------MFTVRTFSVEEAAAICCDVDSCDENMSLSESTYDSCESDDFIEP CinPB5 ------------------------------------------------------------ CinPBD1 -------------------MAVKGVSADETIWSFLEAESEKDKGDAAYACSSDESDILMD TniPB -------------------------------------------MGSSLDDEHILSALLQS BdoPB ------------------------------------------------------------ AgaPB3 -----------------------------------MADIEWLT--PEELSMMSESQKSAY AgaPB4 -----------------------------------MEEIEWLT--PEELSNLTEEERTAY AgaPB5 -----------------------------------MESNDWLS--IQQLDELSLEERERY AgaPB2 -----------------------------------MTDIEWLELSPAELESLSDADKLNY Pigibaku1 --------------------------------------MAKRNSAQRALELILEDREVFD Pigibaku2 --------------------------------------MSARYNAEEALELIFT--HVQQ Pigibaku3 -------------------------------------MSGYGPEALKMWDTLCISQPLME AgaPB9 ------------------------------------------------------------ AgaPB10 ---------------------------------------------MLEEQEDTDFSSFGF Pigibaku5 ------------------------------------------------------------ TruPGBD2 ----------------------------MQHVKSLIISFIYREDTSYEDSSEEEWNSSAT AgaPB1 --------------------------------MFISDKESTCQGPGRKHTYVADIGTGPS DmLOOPER1m -------------------------------------MEDISTVLEKNLEGILERGESIE AgaPBD1 --------------------------------MGDAMHVQWLSEETEEVPENEEDMLYED TruPGBD3 MATARKGRELVTILETSADAESSTACDGRESPLNLSADVKWFEIPYRKPDSDEEEEVREE TruPGBD4 -----------------------------------------------CVEPDIPFCDAEV DpuPokey5 -----------------------------------MQKKADAKKVAQHKAANRNWKECKV DmeCG9839 ----------------------------------MSSSGRKRKQQLKPRQDDHRSPVKRR OsaPB ------------------------------------------------------------ AgaPBD3 --------------------------------------MFPLPSNCDPVFTMAALGPYVV DmeCG13151 -----------------------------MECVLDEELLANIKCSDQEEEDEDGEKMEVE NhaPB ----------------------------------MRGTKSLIPEGIPANSPPKHHQFILI AgaPB6 DTDTDTNVSYDSDQLDEILKELADEEEKEE------------------------------ AgaPB7 NTDMDTEVSYNSNELEEILKEIAEEEDMEE------------------------------ AgaPB8 DNYDGSDCDCDESSLPDVFREMELEEERNH------------------------------ AgaPBD2 KSDESDMENNIEEVMQASIMEELDEDSQEQ------------------------------ BmoPB1 ------------------------------------------------------------ HsaPGBD4 FSEIDDSDNFSDSALEADKIRPLSHLESDG------------------------------ CinPB3 ESDHDEDDDVGSFIVPNVADISDSDSESSD------------------------------ CinPB4 ESDHDEDDDVASFIALNVAYSSNSDDDSSD------------------------------ Pigibaku4 PASAHCAGIGSS----------PPATLSGG--------TSG------------------- TruPGBD1 PLDSDDSCLSDSGDSDEEYTPGPGDEPSGS--------SSDEDADVPPYAPPSAAGARRE CinPB2 SSEDETDNTVQESFQDTVMNISVPDKVESE--------HKKKHVYR-------------- HsaPGBD1 SSLEYAAGDITRKGR-KKDKARVSELLQG--------LSFSGDSDVEKDNEPEIQ----- Mmupgbd1p ASLQY----ITQKGR-EKAKFRVIELLQG--------HAFSDESETEEDNEPEVQ----- HsaPGBD2 APPDNAAGEFTDEDSGDEDS-QRGAHLPGSVLHAS-VLCEDSGT-GEDNDDLELQ----- Mmupgbd2P APPDNASGDFADEGSGGEDSEQNGAZLPGWVLRALVVLCLGTQTXEEEEEDPELQ----- HsaPGBD3 QPPENATAPVSDEESGDEEGGTINN-LPGSLLHTAAYLIQDGSDAESDSDDPSYAPKDDS HsaPGBD3P3 QQPETAAAPVSVEDSGDEEGGIINN-LPGSLLHTVAYLIQDGSDAESDSDDPSYAPKDDS HsaPGBD3P2 QPPENATAPVSDEDSGDEEGGTIKN-LPGSLLRATANLIKXDSDAESNSDDPSYALKFDS HsaPGBD3P1 QPPENATTPVSDEDSEDEEGVIINN-LPGSLLFATAZLIQDGSDAESDSDDPSYAHNDDS HsaPGBD3P4 QSPENATAPVSDEDSGDKEGGTRNN-PPGSLLPATAYLIQDGSDAGSDZDDPSYAPKDDS HsaPGBD5 SDSFTASSSPPPSVWSELEHIRGKSEATTELKRPSLPGSIHSCLCGVWCGVGKRTPSSLV Mmupgbd5 ------------------------------------------------------------ TruPGBD5 ------------------------------------------------------------ CinPB1 ILTASPSTSANIQPVSVQDQEVSSTDSDVSSACAQPVHPKRAKMTKVKTNRKRPKVTNTS CinPB5 ------------------------------------------ELLETETNR--------- CinPBD1 EFNATSSK------------NVDAPNHCCLSSDDETTVHTSSKLQKLLNDRSKSKRTVQQ TniPB DDELVGEDSDSEISDHVSEDDVQSDTEEAFIDEVHEVQPTSSGSEILDEQNVIEQPGSSL BdoPB ------------------------------------------------------------ AgaPB3 -ERKMCDFLRN-SEDCEVESIYNDEEDQSIFVLDNICDSDAEEIQLPEYNASDSDNDDDF AgaPB4 TQQKIHEFMEYGSEDENMISAVVEEDEIPVFDQV-IIDSDAEEVQLPEYNPLETDSDDDY AgaPB5 NQQRLQEMAEEGSDEEVLLFPSTGEDQNDCLVSGALNDSDAEELQVPEYNHIQXDSGDEY AgaPB2 RQKILDELTEQ-------VVGYLEEDD--IASIANFDDSDVEDIEIPQYDYDETD-DEDF Pigibaku1 DDVEGEDSEEEVSEFEDHISENSESDSDSEEDDEIEHQPVPKQRRATGPGRQQPSPGPEQ Pigibaku2 DSSDSEEEVEDLSEEEDGEEYNPEHDESSSEE--------------------------EE Pigibaku3 LZKKPIMLEVNLTRFSFCVIQRTSYSFFFFMKFGDFFSSGVMNWR-------------AE AgaPB9 ------------------------------------------------------------ AgaPB10 VVPRRKQRRVLRFFYQLKMKKLVSE----------------------------------- Pigibaku5 ------------------------------------------------------------ TruPGBD2 KRGAVGKHRCSDSVSPLSMSLRSPSKRKEERCMCCPGPPRKRISNASTLPKVSSSLQAVG AgaPB1 KETCRASSTRQATDSNAGRTPRVVPAKSKKDQVDIQSKEAAKTNRTLEGSLGKLAVGSVV DmLOOPER1m IDLLENTVIEGCEPDSCVVVDSCLEKIDP------------------------------- AgaPBD1 VEYIEEYVHFPDGPESNVSGSVAVQNEESTG----------------------------- TruPGBD3 EEEDDGGVGGGEGENGFAAAAAEPADAASFIAGGGCNIILVTGSNGITHDEEEYAEDCYY TruPGBD4 QSADQRDLLTQNSDLPSSTWKSANSWKHPG------------------------------ DpuPokey5 WGDVGRQSRADDDSPRPQFQERAIQFAPLE------------------------------ DmeCG9839 SVDIKSEPLDGYPALADYDLSTADIKPDLTELQLQLVAEQQAASNTIRLELEQQESDSDE OsaPB ------------------------------------------------------------ AgaPBD3 IEPLDSEYVVNDTGPAACAEATPNTDGGGE------------------------------ DmeCG13151 ERLPPVDSTVQSASFNGDDSDPLQEAVCNFPWIFEDSDMLMNEDQLADVVLKKEDSARPA NhaPB PSMTSPPILEEIQVINPYDDNSFIKEEHS------------------------------- AgaPB6 -SNIELP-SSLETINFTEFLGGQKTFQ------------------FTGKGGLKTSHY--- AgaPB7 -EDVELA-PSLDAIQWSEFSGRQKSFE------------------FTGKEGIQIEHS--- AgaPB8 -EGLPQQKSTIQSTAWSEFTGRQKSFA------------------FVEENQLSLPP---- AgaPBD2 -ATGRCVNALEARSSWKPWAGKQKPFP------------------FFRKKRLRVDLP--- BmoPB1 ------------------------------------------------------------ HsaPGBD4 -KSSTSSDSGRSMKWSARAMIPRQRYD------------------FTGTPGRKVDVS--- CinPB3 -DSLPPPPPPANVWKSSITQQSLNSFL------------------GQHGPSSHACVS--- CinPB4 -NSLPPQ--PANVWKSTITQQSLNSFL------------------GQQGPSSHACVS--- Pigibaku4 --------RKZVRESVEEG-------------------------------TEDRCDW--- TruPGBD1 AATTQRNRQKVAWETVKQENSAKEVPV------------------WQDALPDAEAIR--- CinPB2 -------WRKRNIPVTDSN--------------------------FQLQKDNIDSIH--- HsaPGBD1 PAQKKLKVSCFPEKSWTKRDIKPNFPS------------------WSALDSGLLNLK--- Mmupgbd1p PERKKIKASSIPEKSWTKRDSKPNFPS------------------WSALDSGLLNLK--- HsaPGBD2 PAKKRQKAVVKPQRIWTKRDIRPDFGS------------------WTASDPHIEDLK--- Mmupgbd2P PAKKKQQAAGKPQRLWTKRDTHPDFGX------------------WEVSDPHIEDLK--- HsaPGBD3 PDEVPSTFTVQQPPPSRRRKMTKILCK------------------WKKADLTVQPVAGRV HsaPGBD3P3 PDEVPPTSTVQQPPPSRRRKVTKIVCK------------------WKXADLTAQLIAARV HsaPGBD3P2 PDEDPSTSTAQQLPPSRRRKVTKIVCK------------------WKXRDLTAQLVAGRI HsaPGBD3P1 PGEVPSTSTVQQPPPSRRRKVTKVVFK------------------WQNADLTXHPLAGRV HsaPGBD3P4 PDEFSSTSTAQQPPPSKRRKVTKIVCK------------------GIKAGLTVQPIRGRV HsaPGBD5 SSLQDLELLGQRQRQLWMESTPRPPYN------------------PFLVPCTPVGKLSAE Mmupgbd5 ------------------------------------------------------------ TruPGBD5 ------------------------------------------------------------ CinPB1 NIPHDLQDFNWEPVNNSFETSFIPQSS------------------SFSETSGYGGDL--- CinPB5 ----------------------------------------------YAAHT--------- CinPBD1 THLEELSAEDSMEDWVRIVTDYYPEDH------------------NLRETVMESG----- TniPB ASNRILTLPQRTIRGKNKHCWSTSKST------------------RRSRVSALNIVRSQ- BdoPB -------------------------ST------------------RRSRVSALNIVRSQ- AgaPB3 EEAID--PSNS-YKARDDTFWHSQ-PT------------------VPRKILSHNILRS-- AgaPB4 AESFQ--LSSATYKTHDGTIWSSQ-PT------------------IPRKILAHNILRS-- AgaPB5 SEEWLDEYTAEEYKZKNGTVWSSEHPG------------------NTHKILAHNILRZ-- AgaPB2 DEEYELENAPESYTARDGTIWTTQ-PP------------------PLRKILMHNVIKDNL Pigibaku1 ASQHG---GEIWMSKNSEIEWSSRPRK------------------GPPHKAAN-VIRMQ- Pigibaku2 NPEAE---RETFLSKNGKITWSSAEYD------------------QHGRRAEQNVIKMT- Pigibaku3 SGHVG---VSLNVCTEFRYVDLRTVIS------------------TLPHQSRSNVIKMT- AgaPB9 -----------ZSCALSWKLVTRPASP------------------GKRPSGFVASSS--- AgaPB10 -KNIQQFKKNGSNRNETMXSFTHFAST------------------FGAKTNIEKVRN--- Pigibaku5 -------------MRWRATLLIPNLAE------------------FENEDETEHDRN--- TruPGBD2 VFSSGEKQAEKELARNEPDADRWHDMD------------------EEDFEPPQPRFRPER AgaPB1 EAPDGTQWKVVEVNNANGGIVAEVNVI------------------RDVPGPSAYAKR--- DmLOOPER1m -----------KTLKWRTRPFVAPESI------------------WEDDKTFDVG----- AgaPBD1 -HVIKIESIDHAFDMLQNSVWSIKPPE------------------RTGTMGRKVAHPRP- TruPGBD3 STSTNCSDATSNDSDIDFSDLEEEERRSFFCFGDDLDDDCASPDFWGEPDQVISIEPFSA TruPGBD4 ----DANTKDHRIIPFVESCGPRHFLP--------------------------------- DpuPokey5 -------EPGPVLSQFNRFSNPLGVFKS-----------------MLGGEDTLYLLR--- DmeCG9839 DGYSELDYQAEDVFCQDDMDDYDPDWS-------------------SQQTGSRLLFKFPI OsaPB --MQEPPDLFVHSDGSTETKLIKEKRK--------------------------------- AgaPBD3 --PEQQSDDDDLICLWEEPQTFG---------------------IFDEPVGTNVPFDG-- DmeCG13151 APKRGRGRPPNNNGNYTSPCGQLWSVT------------------RSPDISAEDLPLLGQ NhaPB -HCLWQDDPTQAVNLPAENDRGTNFKP------------------FHVEIRKFRISP--- AgaPB6 ---------KNITPGESLSLFIND--SVLKLIATETNNYAHKKYANGTKN-------KHA AgaPB7 ---------GKITAEESLSLFINN--DILKLIANETNKYAEAKYTR-IIE-------KHA AgaPB8 ---------LDMTPYNVFQLFVDQ--EIIEMIVTQTNKYALQKLDNATLS-------QGA AgaPBD2 ---------AKSTPYEIFSLILDD--KLVAHIALAMNLYMEKKNAQ------------KS BmoPB1 -----------------------A--DIIAYIVRETNRYGAQLIRSTIPSK------PNS HsaPGBD4 ---------DITDPLQYFELFFTE--ELVSKITRETNAQAALLASKPPGPK------GFS CinPB3 ---------NDDSPLEYFRLIFTD--ELLTLVVEETNRYAAQYLQKTSLS-------SKS CinPB4 ---------NKDSSYECFRLIFTD--ELLTLVVEVIIRYASQFIZKTSLT-------PKF Pigibaku4 ------------TQYMYFKQFVTD--EMLQETAEQTNLYSVQ-----------------N TruPGBD1 ------------LPIQYFRDFFDG--ELLDKIVEQSNLYCTQ-----------------Q CinPB2 ------------SPITYFMQFFPE--SLIRTIVEQTNLYSTQ-----------------K HsaPGBD1 --------SEKLNPVELFELFFDD--ETFNLIVNETNNYASQ-----------------K Mmupgbd1p --------SEKLNPVELFELFFDG--ETFNLIVNETNNYASQ-----------------K HsaPGBD2 --------SQELSPVGLFELFFDE--GTINFIVNETNRYAWQ-----------------K Mmupgbd2P --------TKELSLVGLSELFFGD--GTTSYIVHETNRYAX------------------- HsaPGBD3 TAPPNDFFTVMRTPTEILELFLDD--EVIELIVKYSNLYACS-----------------K HsaPGBD3P3 TEPPNDFFTEMXTPTEILERFLDD--KVVELIVRYSNLHARS-----------------K HsaPGBD3P2 TEPPNDLFTEMRTPTEILELFHDD--EVVELIVKYSNLQARX-----------------K HsaPGBD3P1 TEPPKGFFSKMRTPTELLELFLDE--KFFEFIVKFSNLYAGS-----------------K HsaPGBD3P4 TESPNDFFTKMRTPIEILELFHDD--EVVEFIVKGSNLCARS-----------------K HsaPGBD5 HGGPTRKMPPSASAVDFFQLFVPD--NVLKNMVVQTNMYAKKFQER------------FG Mmupgbd5 -------MPPSASAVDFFQLFVPD--NVLKNMVVQTNMYARKFQER------------FG TruPGBD5 -------MPDTATALDFFQLFVPD--NCIQNMVVQTNMYAKKFQER------------YG CinPB1 -------VLADSTPLDLLGLFLTN--EFWQLLVDIFKSKLTSYLQKQTDELP-----KFS CinPB5 --------LDNKTPTPS------------------------------------------S CinPBD1 --------MDGVTPLDYLAMFLSA--EFWDLLVTETNRHAAQTLRKK--KLK-----KGS TniPB -RGPTRMCRNIYDPLLCFKLFFTD--EIISEIVKWTNAEISLKRRESMTG---------- BdoPB -RGPTRMCRNIYDPLLCFKLFFTD--EIISEIVKWTNAEISLKRRESMTG---------- AgaPB3 PSSGPTKKTKSLSIMNTFKLLITP--EICDIIIRETNRKAKQTLEKLQTENP------TA AgaPB4 SQSGPTLKTEGLSIIKTFKLLMSD--EMIDIIVRDTNRKAQQIYEREQVTNSG----KSA AgaPB5 KNTGPX-KTKVLSIVHTFKQLVTE--EMCDLIFRETNRKAILCFQNSNESDR-------V AgaPB2 ASHLKNKSDKDKSAVDIFKLFFST--PICEIVIRETNRKADQFCANYNASHP-------D Pigibaku1 PGPD-MAVTHTRDIKS-FELFIPD--SIQEIILDCTNLEGRRVFGE-------------- Pigibaku2 PGPTRYAVSHARDIVSSFYLFITP--AIEKIILEMTNLQGFRKYGD-------------- Pigibaku3 PGPK--------RFASAFQLFIFP---IERIILEMTNMEXRPVFQE-------------- AgaPB9 ----------DLTIPASYDRFVSD--HLFEKIATQTNLHAVAQSRCP-----------NP AgaPB10 ----------CRTVQDFYSLLVTH--ZIFEYISEQTNIYAAQSNNSS------------N Pigibaku5 ----------GWTPLNYFEQFIDR--DLMKTIADCTNAVSLS------------------ TruPGBD2 VPGPQLNRTANYTPLELFQLFFST--TVIDNLVKHTNANGKKKRQ--------------A AgaPB1 -------YVVAGAVSSSWRLIIDN--GILNQIRKCTEIEARRVLQT-------------- DmLOOPER1m ---------DIKTTVEFFYTLFDT--QLIHLMARQTDIYSLQEHG--------------- AgaPBD1 --APVGLAKSAKSPAECLSLFLDA--DVIAMITEYTNEQIKAEQPN------------YA TruPGBD3 VCGPQHSLGDDADTRDYFRILFPD--SLFEHMVEQTNKYALYRQRRS-----------GK TruPGBD4 ---------KNSDAIDFFNLLFPE--TLIELISKETNDHAKICQFLWS------------ DpuPokey5 -----------EATNDYIAEFWSS--RKTPPSRKVGGKPEGRLIG--------------P DmeCG9839 QQSGLKFGQRFQGPQHYFNQVLGNRSKFFSSLAQSCNLKGGE------------------ OsaPB --------HFDSASSSFFAYLPLS---FWKAVLGETNKYAAAS----------------- AgaPBD3 --------ADERTASEYAALVCDD--ALFDILVKGTNRHRKQWADCMRAG--------GQ DmeCG13151 QACGKGPARTVSNAVEAWMLLFDD--EMLRSLLRHINEQMRKRRTAT------------- NhaPB ---------LPPTPLQLFQLFLPIS--LVEKWVSYTNSWITCLKENGVVDSWNNPMGKTS AgaPB6 RGNYWTPTNEHEVKKIIGILIWLG-FF---QF-PLEKYWSESP----IFNFSFLKKLISR AgaPB7 RGNSWTPTNEGEIKKLLGILIWMG-FH---QL-PMKKCWSTNE----MYNFSFLRNIMCR AgaPB8 RMSKWKPTNSAEMKKFLSLLLWMG-LV---KVNPVVNYWSKNT----LYNFKLPSTVMSR AgaPBD2 KASKWLETNPKEVRKFIGLMIWMD-LV---RVGRLEDYWSESA----LYNFAVPRAAMYR BmoPB1 RLSRWKDVTSDEIYGFXVLMLQSL-VI---DYVEREYWYAVIE----ELQIGNFKEIMTY HsaPGBD4 RMDKWKDTDNDELKVFFAVMLLQG-IV---QKPELEMFWSTRP----LLDTPYLRQIMTG CinPB3 RAHKWKPVDAEELSLFLGLTLLTGVVH---KRGKLESYWIKNS----MIETPYFGKCMSR CinPB4 RANKWKPVDAKGMCLFLRLTLVT--SI---KRRNLGSKWSKDS----MIEX-YFGKSISX Pigibaku4 -ECKSVNTTAKEIEQVLGMYMHMG-LV---QMPCVRAYWEMET------KLPAVCDVMSQ TruPGBD1 HPNRALNLDRPELEQFLGTVVYMS-IF---LLPWSRMYWSSTS------RVQQVAEVMSR CinPB2 -IGVSINTNYSEICMFIAIQIKMS-IL---HLPSYLMYWSKEM------RFPPIADSISL HsaPGBD1 --NVSLEVTVQEMRCVFGVLLLSG-FM---RHPRREMYWEVS----DTDQNLV-RDAIRR Mmupgbd1p --NVSLEVTVQEMRCVFGVLLCSG-FV---RHPRMGMYWEIS----DSDQTLV-RNEIRR HsaPGBD2 --NVNLSLTAQELKCVLGILILSG-YI---SYPRRRMFWETSP---DSHHHLV-ADAIRR Mmupgbd2P ----TLNLMTQELKCVLGILILSQ-YI---SYPRRLVFWETAP---DSHHRLV-ADAIRR HsaPGBD3 --GVHLGLTSSEFKCFLGIIFLSG-YV---SVPRRRMFWEQR---TDVHNVLV-SAAMRR HsaPGBD3P3 --GVQRGLTSSEFKCFLGIIXLND-YI---SVHRRHTFWEKR---TDAHNILV-CAAMRC HsaPGBD3P2 --GVHLGLTSSEFKYFLGIIFLSG-YI---SVPRSRMFWEQQXNKPDAHNVLV-IAAMRR HsaPGBD3P1 --GVHLGLTSSKFKCFLGIIFLSA-YV---SAPRRRMFCKQR---TDAHNILV-SAAMRC HsaPGBD3P4 --DVHLGLTTSKFKSFLEIIFLSG-YI---SVPRRHMFGEQX---TDAHNVLAZCTAMRR HsaPGBD5 SDGAWVEVTLTEMKAFLGYMISTS-IS---HCESVLSIWSGGF----YSNRS-LALVMSQ Mmupgbd5 SDGAWVEVTLAEMKAFLGYVISTS-VS---HCESVLSIWSGGF----YSNRS-LALVMSQ TruPGBD5 SDESWHPVTAEEMKAFLGFVTSTS-IH---RCESVLSIWSSGF----FSNRS-IALKMSQ CinPB1 KFRKWSPVTHADIKAYFAMNLLMG-LC---SKHSIKDYWSMYS----YTNTAGISSLMPR CinPB5 RLQRWKDTNIPEMKAYFVLLLTMG-LC---HKPDINDYWSAFS----VTLTSGYGKIMSR CinPBD1 NLRTWKDTTVAEMKAYFAILLSMG-LC---NTVDMQDYWSASW----ITVTSSISKIMSR TniPB --ATFRDTNEDEIYAFFGILVMTAVRK---DNHMSTDDLFDRSL------SMVYVSVMSR BdoPB --ATFRDTNEDEIHALFGILVMTAVRK---DNHMSTDDLYDRSL------SMVYVSVMSR AgaPB3 QSRSWNPLTTNEFDAYLGILLEAGVTC---SNHVHAADLWKTNS------HPLFRASMSL AgaPB4 SMHTWKTLTKSEFEAYLGILLLAGVMR---SNYVHSTELWKTSS------HPIFRATMSL AgaPB5 HSKDWKPLTSSEFDAYIGLLLLAGVX------YMPVTELWKTSS------HPMFRASMSI AgaPB2 SNIQWQPLTPSELDAYIGILIEAGVTH---SNDLALEELWKTNS------HPLFRASMGL Pigibaku1 ---RWKELDQTQLHAYFGVLILAGVFR---SKGESAESLWDAETG-----REIFRATMSL Pigibaku2 ---SWKKMDETDLQAYLGLLILAGVYR---SRGKAAASLWDAESG-----RPIFRATMPL Pigibaku3 ---KGKPVNQTDLHGYIGMMLLAGGYM---SKGEATTRLWKEENG-----RPIFHAKMX- AgaPB9 SPEAWVATDQQEIKRFFGLTWYDC-------XPPLRLYWSDDP----AYVQTFPKSAMSG AgaPB10 RSKKWYPTNKDEIKKLFGLPIWMG-LV---KLPEIRLYWSTKP----IYAQSFPRKIMSR Pigibaku5 RSGDLLKTSVDEVYHFFGACILMS-CV---PYPKMRMYWSKSLR------FTSITDRFTR TruPGBD2 QQKHWHTVTREDMYSFLSLVLYMG-MV---PLKAMTDFWKGSK----LYRLPFPSSVMPS AgaPB1 ---KNWTLSFAELEAFLAILYIRGATE---SKGMEIDLMWSEKYG-----LPFCKNVMSR DmLOOPER1m ---IELKCTDEEIKRYIGILLYFG-VL---KLPQFRMAWSKDLK------ITAITDSMPR AgaPBD1 RERDANPTDEMEIMALLGVLYIAGTVR---DGRENIERLFDTKMG---TGLEAVYLTMTS TruPGBD3 SDPHWHPTDVREMKAYVGLNILMG-IN---QLPDTGMYWASDIFIG----NAGFKKTMTA TruPGBD4 SFPDWVPVTNSEIRGFIGLIILMG-IK---NLPDLSQYWSWTHN----DNSYTFYQTMSL DpuPokey5 RLPAGGFVTDHELVAFFGIQFLIG-YH---RLPELSMFWEQQPD--AGLGLGIIQQAMTR DmeCG9839 --LKSNPTTAEEMEIFMALSLLMC-DL---KLEHLSDYWSTNMFYG----LVGFSGKIPL OsaPB -PAKGKTVTLEELMRFFGIMFYMT-IV---DKGEYSNYWGEQVED----EIFGVTSTLGL AgaPBD3 SVEPYRKVTVAEMKRYVGLLLVMG-QV---RKDCQHCYWSTNP----LLETPVFANTMSY DmeCG13151 --SVQRPLDVVELRAFLGLSYLCGVFRNARHNGPLDELWTLELG------NAIFRASMSL NhaPB YLHKWEGTTVSEVLTMIGVLIYMDVHK----EKTIRSYWNPPKPG-VQRPAHSFIKFISY . : AgaPB6 QRFQLIMSNFHLSDNERIESPTRL------------DKISPLVQLLINNYQAVYTPG--K AgaPB7 IRFELLLSNFHLADN-STDSQNRL------------YKIAPLIEMLLQNYQTIYTPG--K AgaPB8 NRFEILLSNLHFTDNTSISPKNRQ------------GKIINLMDKLQEKYQKVYTPG--E AgaPBD2 ERFRALLGAFCFYDDGTSKTDYKEP-----------GKIGAFIDVLQSKFQALLHLG--E BmoPB1 NRFIVIKRCLHFIDNATLPVPPT-----------KLDKIIPIIEHLNKKFKSLYVLE--Q HsaPGBD4 ERFLLLFRCLHFVNNSSISAGQSKAQI-------SLQKIKPVFDFLVNKFSTVYTPN--R CinPB3 NRYQAITGFLHFNDNEKLAENIDND---------KLYKVRPVYDLIVARWKALYNLG--E CinPB4 IZYQVITGFLHFNDNKKLPENIDND---------KLYKILSVYYLIVARWKSLYNFG--D Pigibaku4 DQFLKLLTKIHFKDNLSVSDDAKKD---------KLWKLRPWLQKLRDQFLCIRPEE--C TruPGBD1 DRWEEIKHFIHFCDNSAPNNDDR------------LFKIRLVIDSLLPKFQALPQHQ--M CinPB2 KRYQKLRRFLHFVDNSTFNSDNP-N---------KLFKIQPVLDAVRNECIKIQPEQ--S HsaPGBD1 DRFELIFSNLHFADNG---HLDQKD---------KFTKLRPLIKQMNKNFLLYAPLE--E Mmupgbd1p DRFELIFSCLHFADNK---HLDQKD---------KFSNLRPLIKQM-KNFPLVCPPE--E HsaPGBD2 DRFELIFSYLHFADNN---ELDASD---------RFAKVRPLIIRMNCNFQKHAPLE--E Mmupgbd2P DRFELIFSYLCFMGNSG--LYDESD---------RFAKFRPLIVRMNCHFQKHAPLE--X HsaPGBD3 DRFETIFSNLHVADNA---NLDPVD---------KFSKLRPLISKLNERCMKFVPNE--T HsaPGBD3P3 DHFETIFSNLHVADNA---NLDPMD---------EFSKLQPLISKRNERCMX-------- HsaPGBD3P2 DRFETKFSNLHVADDA---NLDPMD---------KFSKLRLLISKRNERCMKFVPNE--T HsaPGBD3P1 DRFETIFSNLDVADNA---NLDPMD---------KFSKLQPLISKLNERCMKFVPNE--T HsaPGBD3P4 DCFEXTFSNLHVADNA---NLDPMD---------QFSEWZPLASKLNERCMKFAPNE--T HsaPGBD5 ARFEKILKYFHVVAFR----SSQ-TTH-------GLYKVQPFLDSLQNSFDSAFRPS--Q Mmupgbd5 ARFEKILKYFHVVAFR----SSQ-TTH-------GLYKVQPFLDSLQSGFDAAFRPS--Q TruPGBD5 SRFEKILKYFHIVAFR----PSQGSNQ-------GLYKIQPFLDSLQQSFSHTFRPS--Q CinPB1 DRFQSIRAFLHFNNNENYIPRGQPGHD-------RIFKIRNIVELVTKNFSKHYTPH--K CinPB5 NRFLLIRSMLHFCNNEDFIPRHEENYD-------RLFKIRRLVDIIVPKFDQVYKPQ--K CinPBD1 VRFTLIRAMLHFCNDEESSSKNSQKHN-------RLFKVRQLIDVLVPKFSALYKPD--K TniPB DRFDFLIRCLRMDDKSI--RPTLREND-------VFTPVRKIWDLFIHQCIQNYTPG--A BdoPB DRFDFLIRCLRMDDKSI--RPTLRGND-------VFTPVRKIWDLFIHQCIHNYTPG--A AgaPB3 NWFWVINRFIRFDDSRT--RTERKKED-------KATAISGVFGMLLKNLQSCYIAG--M AgaPB4 QRFRSINRFIRFDDRRT--REVRKKMD-------KSAAISDIFAMLNRNLQACYVAG--S AgaPB5 QRFWSISRFIRFDNGQT--RQQRKTMD-------KAAAISDVFQMLYANLKSCYVPG--T AgaPB2 KRFISITRFIRFDNGST--REQRKKTD-------KAAAISQIFGILNTNLNSCYKPR--N Pigibaku1 ENFHIISRIIRFDNZDD--RPARWQRD-------KLGVIRTVWDKWVRRLPLLYNPG--P Pigibaku2 KHFHTYSKLLRFDDRES--RPARRVTD-------KLAAIRDVWDKWVEWLPYLYN----T Pigibaku3 ETFHMILRVIRFNNHDT--RLGDVKKT-------------NYKQRYVGZMGZNYLVV--Q AgaPB9 ERYAHLLHMIVFCNXSS---QEQLNRP-------FLSKIQPLVDTLQANFKKHFVPTEEE AgaPB10 DRFEILLKMLHFSNNELEVKSDRLS------------KVSYIIKALNQNFQKYYDPP--E Pigibaku5 DRFFKLRQSLKVLIDDDVPEDLRKS-D-------KFWKVRPFLDRILQCCRSQTRPE--C TruPGBD2 NRFLAISRSLHINDPAVETANDLKKGTPGY---DKLCRIKPLYEQILAACYTFFHPY--Q AgaPB1 NRFREIMKFLRFDEKSTRSQRLQTD---------KFALISDVFSRFVSNCQTNYVPG--P DmLOOPER1m GRFKKIKQCLHFNDNAKQLKKGDCNYD-------KLYKIRPLLRILKXILEKLTQEE--- AgaPBD1 LRYHFLIRSIRFDDPTAAPDEIEGD---------KLAPIRPIYERIVSNCQKYLRPG--R TruPGBD3 RRFEKLTQYLQLCDREFEPGRGERGYDG-------LFKVRPLLDVVENTMWDAYVPN--R TruPGBD4 IRFRQIAANIRMGSVTTAECRGAQSSD-------ALSIFRPMLEILGGAMWSTYQPN--C DpuPokey5 ERFKFISKHIACASPWDDVDPNSDDPDQEPERPDPIRKIRPLVKRLNERYHACRKPP--R DmeCG9839 ERYQQLLHCLNFDAPQLQAGRAKVKNS-------------LLLDFINERMEEIYICG--Q OsaPB EKLMTLKRFYIRKNLCFRYDISKADLKK-----DPAARIRPLINMIKHTSLKYVVLG--R AgaPBD3 KRFQQISHYFHGMKQAN-----------------RTYDAKPVLDHLVPKFQALYAPK--Q DmeCG13151 ARFESISECLAGNCGWS--------------------EGQKLWQRLIINCRSYYGCS--S NhaPB NKFQLIHRRLRPFDHTKYDETAPIP--------KVFQCVEEWSDHIQAVSMQIFLPG--S AgaPB6 DIVIDESMVPFK-------GCLIFKQYIPTKAHKYG-IKLFKLCCN-E------GYTWSM AgaPB7 DIVIDETMVPFK-------GRLIFKQYIPSKAHKYG-IKLFKLCCT-E------GYTWSL AgaPB8 NIVIDETLIPWR-------GRLIFRQYIPSKAHKYG-IKMFKLCSS-E------GFTWAS AgaPBD2 DVVVREMLALGR-------DRTSFKQYIPASAHRHGRWALFKLCSL-E------GYTWGL BmoPB1 NIAIDESLLLWK-------GRLSFAQKIATKRPRVG-IKSYELCESRT------GYLWQM HsaPGBD4 NIAVDESLMLFK-------GPLAMKQYLPTKRVRFG-LKLYVLCESQS------GYVWNA CinPB3 HISIDEGMMKWR-------GRLGFRVYNKDKPIKYG-IKSYILADSHS------HYCWNL CinPB4 HISIDEGMIKZR-------GKLGFRVYNKNKPIKYR-IKSYFLAD--S------HYCWNL Pigibaku4 HAVDEIMVPFKG-------K-SHLRVYMPAKPHKWSFKMWGRAGQS--------GFLYDF TruPGBD1 LCVEKQMVPFKG-------R-SALRQYSPQKPYKWGYKLFVLCDTT--------GLVHSF CinPB2 HSVDEQIIPAKT-------KYSKFRQYNPKKPVKWGFKNMVRADSS--------GFMYDF HsaPGBD1 YYCFDKSMCECF-------DS---DQFLNGKPIRIGYKIWCGTTTQ--------GYLVWF Mmupgbd1p YYCFDKSMCECF-------DC---DQFLNGKPLQIGYKIWCGTTXQ--------GYLVWF HsaPGBD2 FYSFGESMCEYF-------GHRGSKQLHRGKPVRLGYKIWCGTTSR--------GYLVWF Mmupgbd2P FYSFGESICEYF-------EHWGGGWVGGVQASALR------EASR--------GYLVWF HsaPGBD3 YFSFDEFMVPYF-------GRHGCKQFIRGKPIRFGYKFWCGATCL--------GYICWF HsaPGBD3P3 ----DESMVPYF-------GRHWCX-FTQGKPVLFGYKFWCGAICL--------GYICWF HsaPGBD3P2 YFSFNESMVPYS-------GCHRCKQFIQGKPIMFGCKFCCGATCL--------CHICCF HsaPGBD3P1 YFSFDESTFPYF-------GRHRCEQFIGGKPIQFGCKFWCGATCL--------GCICWF HsaPGBD3P4 YFSFDESRVPYF-------GCQGCKZFIWGKPIRFGCKIWCGTTCL--------GYIXGF HsaPGBD5 TQVLHEPLIDEDPV-----FIATCTERELRKRKKRKFSLWVRQCSS-T------GFIIQI Mmupgbd5 TQVLHEPLIDEDPV-----FIATCTERELRKRKKRKFSLWVRQCSS-T------GFIIQI TruPGBD5 TQVLHEPLIDEDPV-----FITTCTERELRKRKKRKFSLWVRQCTS-T------GFICQI CinPB1 ELSLDEMTIAYK-------ERSSIKQYNPIKP-----KVFVLSEAR-T------GYALQW CinPB5 QLSLDEMTIAFK-------GRSTIKQYNPHKPSKWGYKVFALTEAT-T------GYLLQW CinPBD1 ELAIHEMTVACN-------YKS--EQRVRKKPIQWTDKVYALTEAR-T------GYLLEW TniPB HLTIDEQLLGFR-------GRCPFRMYIPNKPSKYGIKILMMCDSGTK-------YMING BdoPB HLTIDEQLLGFR-------GRCPFRMYIPNKPSKYGIKILMMCDSGTK-------YMING AgaPB3 NVTVDEQLFPYR-------GGTGFTQYIPSKPAKYGIKLWWACDAEPS-------YPING AgaPB4 HVTVDEQLYPYR-------GGTGFTHYIPSKPAKYGIKMWWVCDAVTS-------YSIKG AgaPB5 NVTVDEQLFAFR-------GGTGFTQYMPSKPAKYAIKVZWVCTLZKAKYIQAWQYQVNR AgaPB2 NLTIDEQLFPYR-------GGTGFTQYIPSKPAKYGIKIWWICDSESS-------YPLKG Pigibaku1 NVTIDEQLMPFR-------GRCPFLQYLPSKPAKNGIKIWAACDATSS-------YAWNL Pigibaku2 MVPFRGNLFTYFXCLL-SKGRCPFRQYMPSKPAKYGIQSWVACDAKSS-------YAWKM Pigibaku3 ACSP-----------------YCVPQYTPNKPAKYGMKIGAACDAESN-------YAWNM AgaPB9 DIAVDESLIPGX------RGRTAFRQKQPQYAQQGGNKVFKLCCGT--------GYTYAL AgaPB10 TVSIVESLIPFR-------GRIVFRQYLKNKRHKYGTKIFKLCFGY--------GYTYNC Pigibaku5 VSIDEQMMVPFT-------GACPCRQYLPMKLNPVGIKNFICATTD--------GIVLDF TruPGBD2 HISVDERMVATK-------ARIGLKRYVRNKPTKWGIKLFVLADSSCG-------YTLNF AgaPB1 HISVDEQLFPSK-------TRCPFTQFMASKPDKYGQKYWMAVDVDSK-------YVVNI DmLOOPER1m HQSVDEQIIAFKG---------TFLIFFXSKPHKWGLKMFTRAGIS--------GLVYDF AgaPBD1 FLMLDEQAVQFK-------GKCEFRQILPSAPGRAGFRFHLLVDCETS-------YVSNL TruPGBD3 CLTVDKCSIVTK-------GRFSPAQYMPAKPLRKGLTVWMLCDSRSG-------YCHRA TruPGBD4 SLAVDRALLPSLE------------EGRLKEDAKVQPEVWLLCDSKSG-------YCHRL DpuPokey5 GQSIDESMVKFK-------GRSVLRQTMKNKPIKSGFKIWSRCCHR--------GYTYKF DmeCG9839 QLVLNEPITLWK-------GALRYQDELPNKFRTNALLLHMLTEQS--------GLVVKI OsaPB NVAVDESSIACRS----KFGRHMIVYNAKKPTGKFHFKIYACCCATTWLMVG---FRLHC AgaPBD3 QLIVSELTIPQDVLNGQQTEPPNHSEDAQGSTPESAKRLRLLCESDTG-------YVLNV DmeCG13151 WLTVDETFCAVA---------------KSRMTLCCDARTLYMANAVVS------------ NhaPB HLAVDECMIRYT-------DRSDDITVIKSKPDPVGFKIWVIAQYG---------FFIRW AgaPB6 KVYAGKN------------------DKEKTKLGVGTNVCFELAEKLM---NEGRTLYIDI AgaPB7 KVYAGKN------------------NMCKTKMGLGSNISVELANNLM---HEGRTLYIDN AgaPB8 KIYSGKS------------------SEGIRETGL-AHVCIKLAEKLF---EKGRTLYVDN AgaPBD2 KLCTEQR------------------LIG--EAQLANSVCMELCEPLL---NQGRTVYIDN BmoPB1 EVYTGKGHAHVVQDGEP----EERGQESDEPESATAQIVLNLTRPLF---DKGHTLIMDN HsaPGBD4 LVHTGPG----------------MNLKDSADGLKSSRIVLTLVNDLL---GQGYCVFLDN CinPB3 DMY------------------------HRVQKTLKETVSQILTSKCH---FLWHSLYMDN CinPB4 GMY------------------------HRVQNXLKETVSQLLTZ-----------LYMDN Pigibaku4 DVCQG----------------AQNPESEKSEVGVTGEVVLKMTSTLP--AGKNHKVFADN TruPGBD1 EIFTG----------------EIGPAPGQPDIGASGNIVLKLAQVIP--QNVNHLLYFDH CinPB2 YIYGGKDSK------------QLALSDDATHLQKSAQTVVKLCQHLP--VKQNHQLFFDN HsaPGBD1 EPYQEEST---------------MKVDEDPDLGLGGNLVMNFADVLLERGQYPYHLCFDS Mmupgbd1p EPYQEDS-----------------GVDKELDLGPGGNLIMSFADVLLEKGHHPYHLSFDS HsaPGBD2 EPSQGTLF---------------TKPDRSLDLG--GSMVIKFVDALQERGFLPYHIFFDK Mmupgbd2P EPSX--------------------KPDRGLDX---ASMVVRFVDALQEHSCLPNHIFFDK HsaPGBD3 QPYQGKN-----------------PNTKHEEYGVGASLVLQFSEALTEAHPGQYHFVFNN HsaPGBD3P3 QPYQGKN-----------------PNTKHZGYGVVESLVRQLSEALTEAHPGQYHFVFDN HsaPGBD3P2 QPYQGKN-----------------PNTKYEEYGVGASLIHKFSEGLX-THPGQYHFVFDN HsaPGBD3P1 ZPYQGKN-----------------XNTKHEEYGVGASFTLQFREALIEAHPGQYHFIFDN HsaPGBD3P4 QLYQGKN-----------------PDTKHEESGVGASLVLHFGEAITETHPGQYHFVFDN HsaPGBD5 YVHLKEGG----------------GPDGLDALKNKPQLHSMVARSLCRNAAGKNYIIFTG Mmupgbd5 YVHLKEGG----------------GPDGLDALKNKPQLHSMVARSLCRNAAGKNYIIFTG TruPGBD5 SVHLKEGQ----------------GSDGLAALKNKPQLHSLVAKQLCQNISGKNSIIFTG CinPB1 DLYTGKSE----------------DVDSSVSKTHA------IVRKLSQEYLHKGHDIYMN CinPB5 EMYAGSSM----------------ETDEDVSKTHS------IVRKLCSGYMGKQHEVYMN CinPBD1 AIHAGSSR----------------ETEKGAS----------IVRKLCTRYIGK-HDIYIN TniPB MPYLG-------------------RGTQTNGVPLGEYYVKELSKPVHG---SCRNITCDN BdoPB MPYLE-------------------RGTQTNGVPLGEYYVKELSKPVHG---SCRNITCEN AgaPB3 QIYAG------------------LSPSGIREKNQGERVVKDLCRVFRG---SGRNIICDN AgaPB4 QIYTR------------------LAPSGQRERHQGERVVKDLCRIFRG---SGRSVICDI AgaPB5 ZLYNLSYSLKKLREIZCFLFFFLFKTSGERERNQGERVVKDLCDMFRG---SGRNVVCDI AgaPB2 QIYTG------------------LSPSGEREKNQGERVVKDLCHQFRR---SGRNITCDN Pigibaku1 QVYTG------------------KPDGGAPEKNPRNESCPRHVSGTQ-----WTQHHMRH Pigibaku2 QVYTG------------------KPTSGCPEKNQGMRVVLDVTEGLR-----GYNVTCDN Pigibaku3 QVCTG------------------KLPGFTSEKNQGRYMVLEMSESQQ-----GHNITCDN AgaPB9 RVVCT---------------------KKAQNESTTDDVIVSLCEALFN---GGHTLYTDS AgaPB10 SFYAG--------------------KIHEKEKTTPVNVVMKLSEKLLD---KGHTIXAQT Pigibaku5 DLYQGSG-----------------ALREQVEEPEGLSLGSLAMARLCQTLHRGTKVYCDR TruPGBD2 FVDAGKD-------------------PEPTGKGRSYDIVMRILNVPFLG--KGYKLYMDN AgaPB1 IPYLGKN------------------DERPAEERLGDFVVKKLVDPYLN---RGRNVTCDN DmLOOPER1m TLYVGEG------------------TSPSYGLGISSYVVLYLAESLPK--DKNFKLYFDN AgaPBD1 EICVPEN------------------QNPYNLSYAPTDVAMRLTEPVQG---RQKTVILGA TruPGBD3 KIYVGRP------------------VDDEVAASVGYRAVTSLVRGLEG---QFHHVFMDS TruPGBD4 SIQVG----------------------EKVQQGQGCTVVSELVKGLEG---KHHHLYLAN DpuPokey5 EIYQGARFG--------------EKQGRSRNNEAVERVVVDLCQPLTD---QGFVVAFDR DmeCG9839 LPEIVRKED---------------APAWVRNSRQLVEHRNKIVLKLMEGYHGGRTVYTSK OsaPB DSDMEDRLR--------DVIPAVDAQNLDNRLQFSSSVRQIVLEVTRPIHNTQRVVNTDN AgaPBD3 ELAN-------------------------QQLDQVALTDVSIVRPYFG---RWHHVYWGN DmeCG13151 -----------------------------RNQRCPDKDVEQLICDFKT---TGRNVTLGS NhaPB IWHVKEK----------------------------------------------------- AgaPB6 ---FFTSYELA--LKFLQNKTHVVGTLRFNKKYMPKEVMVSKLK---KGEMISK---EDP AgaPB7 ---FFTSYELA--IQCLK-KSHVVGTLRYNKKYMPKCVMDKPLK---KGEMVSR---EDP AgaPB8 ---LYTSYELA--LTCLDRKTHLVGTLRHNKKSMPRDVLDCKLK---KGEMIX------- AgaPBD2 ---FHASFDLA--QALLANQTHLVGTVRVNGSSMPKDVLLAKLR---KGEIIAR---END BmoPB1 ---FYNAPLLSR-ILKVQHKTDSMGTLRLNREFVPEALKKKTKKNMKEGEVAFS---TT- HsaPGBD4 ---FNISPMLFR-ELHQN-RTDAVGTARLNRKQIPNDLKKRIAK----GTTVAR---FC- CinPB3 ---FYNSVSMS--QMLLAFQIHSVGTLRSNRG-EPREIRTPPNQ-MKKGDIIAR---QN- CinPB4 ---FYNSVSMS--QIXLAIZIHSVVTLRSNRE-EPCEFZTPPIQ-MKKGDIIAR---QN- Pigibaku4 ---YFTSVPLV--QHLKERGIHYIGTIQINRVKDCAMMDEKELKKNGRGSMDFR---VNQ TruPGBD1 ---WFSSLDLF--VALANKGIPALGTIQQNRLRGCTFSADSEMKNKDRGAFEEQQAVVDD CinPB2 ---WFTTLDLL--IYLKEIGINACGTIRGN----------EDLKKNGRGAVDFR--SDFN HsaPGBD1 ---FFTSVKLL--SALKKKGVRATGTIRENRTEKCPLMNVEHMKKMKRGYFDFR--IEEN Mmupgbd1p ---FFTPVKLM--SALKKKGVKATGSLCENKTXKCPLMNVELMKKMNXGYFDFI--VEEK HsaPGBD2 ---VFTSVKLM--SILRKKGVKATGTVREYRTERCPLKDPKELKKMKRGSFDYK--VDES Mmupgbd2P ---VXTSVKLM--SILRGKGVKATGTVCEYRIERCPLKDPKELRKTRRYSFHYR--VEES HsaPGBD3 ---FFTSIALL--DKLSSMGHQATGTVRKDHIDRVPLESDVALKKKERGTFDYR--ID-G HsaPGBD3P3 ---FFTSIVLL--DKLSSMGNRATGTVRKDHIEKAPLKLDVALKKKEXGTFHYZ--ID-G HsaPGBD3P2 ---FFTSIALL--DKLSSMEHQATGTVRKDRINKAPLESDVALKKKE-IIFNYG--ID-G HsaPGBD3P1 ---FFTSIALL--DKVSSMGHQATGTVRNDSTDKAPLEZDIVLKKKERGTFDYL--ID-G HsaPGBD3P4 ---FFTSIALL--DKLSLMGPQATGTVRKYCIDKAPLESAAALKKXDRGKFDYR--ID-G HsaPGBD5 --PSITSLTLF--EEFEKQGIYCCGLLRARKSDCTGLPLSMLTNPATPPARGQYQ-IKMK Mmupgbd5 --PSITSLNLF--EEFEKQGIYCCGLLSSRKSDCTGLPPSMLTNPATPLARGQHQ-IRTK TruPGBD5 --PSMTSLSLF--SEFSEQDIFCCGLLSTRKSDCTGLPQSMLVCGSTPAQRGQSR-IMMK CinPB1 --SYYTNPYLA--NELSKLKTGVCGTISATR---KGMPESLKKKNLKTKKGDDPI-FLRS CinPB5 --SYYSNPYLA--KEFKEKKTGICGTINCNR---KGMPDELKKKNLKTKKGDDPV-YMLS CinPBD1 TANSYTNRNLA--KEFVSQTNGSG-----------GIPGELKTINEKNNP---------- TniPB ---WFTSIPLAKNLLQEPYKLTIVGTVRSNKREIP---EVLKNSRSRPVGTSMFCFDGPL BdoPB ---WFTSIPLAKNLLQEPYKLTIVGTVRSNKREIP---EVLKNSRSRPVGTPMFCFDGPL AgaPB3 ---FFTSYNLAISLMED-YKLALLGTVNKRRTFVP---SSFSNPKGREVLSTLFGFSENV AgaPB4 ---FFTSYNLASSLMPD-FKLALLETVNKRRTFVP---PMFANPHGREIQSTLYGFSENI AgaPB5 ---FFTSYNLALSLMLD-YKLSILGTVNKKRTFVP---AFFVKPKGRIPESTLFGFSENV AgaPB2 ---FFTTFNLAKTLMQD-YKLSILGTVNKRRTFVP---FELMVTKGRETESTKFVFQNNV Pigibaku1 ---FFTSHKLGQELLK--RKLTIVGTIRKNRSELP-PQLLTSKNR--PVKSSQFAYTADT Pigibaku2 ---FFTSYELRQQLLK--RKITMVGTVRKNKPELP-PALLASKKRGLLIKVSLHAHHHS- Pigibaku3 ---FFTSYHLGDEHQK--RKLTLLGTVSRKKPELPRESSXILKMQVRPLHSSIFAFTEKA AgaPB9 ---RYTSLSMA--TKLLTKRLHLVGIFNPGRPGNPPAVVSKQLAAGETFAMEKS------ AgaPB10 ---IGTLYELYEAIEKIIRKKLKVGEFIAKEN---------------------------S Pigibaku5 ---LFTSIQGA--EZMMKKELYMTGTVMKNCSIAEVTYXDKSMQNAGRGTSTEVS--TED TruPGBD2 ---FYTSPTLFR--DLLSRKIWACGTLRPNMAGYPKKKGNDMTDKTPRGTIRWMR----Q AgaPB1 ---FFTSLELA--KFLKSKKTSLVGTINKARREVPICVKKVKEKLYFTKAFKSDD----- DmLOOPER1m ---WFTSVILL--ISLKEIGIFATGTVRMIKX---------------------------- AgaPBD1 G---LTSIDLI--EKLYASRTMAMGEVPKSYPDLPKALIANKGRPEHSTLAAYHD----- TruPGBD3 ---FFTSVPLL--QRLLRNGIYACGPTQPGRKGYPEVLRPRNIGKLSQGEFYQCQ----- TruPGBD4 ---SLASVPLL--QKLLDQGIYASSSFPQFSPILPRELWEEGSLDKPGDFHQKQF----- DpuPokey5 ---FFTSIALL--DKLRENGVNAVGTILPSRVNQPIMTKNESNLRPDEFAAKFGG-EPGT DmeCG9839 ---FYGSYGLA--QELAKKSTYCTGLLDRNRYGNSKALVHQRLDSNSISTSYATS----- OsaPB ---WYTSVTLM--LSLRDVGLYGRGTIRENSAHFPKAHMFAKKANEPRGSSLQG--VSNT AgaPBD3 -----DGITVAAAETLYANQTLACGTLRNDPDGTVAPERKSP------------------ DmeCG13151 -----RYLNLTQCEQLAQRQISSLGKLEANSPHWPRQWPTESPLFGGSSKLIPLD----G NhaPB ------PHGAVGVEFQLRSHHHKVGQASEEKSQSKPLI---------------------- AgaPB6 NGIVVLKWRDVRD-VRMISTKHAPVLVSTTSASKP------QRTEKLKPVAVIDYNQGKC AgaPB7 NGIVVLKWKDSRD-VRMISTKHVPRLMPVKSAKNP------KSKEKMKPLAVIDYNLGKC AgaPB8 VGIVVLKWKDSRD-VRMLSTKHAPYMVQTTKKCYSN-----QPATKLKPLTVVDYNKGKC AgaPBD2 DGVMVLKWKGTCT-MGLLSTKHSPALVPMESQVRSNR--RWIRVARIQPEAVIAHIQAKG BmoPB1 KDLSVVVWMDKNI-VAMISSFHPIEVGGIEK-YGYYR--Y-------KPQVVLDYNFSMG HsaPGBD4 GELMALKWCDGKE-VTMLSTFHNDTVIEVNNRNGKKT--K-------RPRVIVDYNENMG CinPB3 QSVTVLAWKDKRV-VKAISTKHDASVTTITRRQRRGG--EXESVE--KPVCIADYNLHMS CinPB4 KSITVLAWKNIRV-VKAISTKPDASLTTITRZQRRGX--EKESIK--KPVCITNYNLHMS Pigibaku4 DNNIIVRWYDNKA-VNLISSFVGIEPVGNVKRWDRK---SKTHIMVPRPAIVETYNKFMG TruPGBD1 VGIRVVKWFDNRG-VIVASTFAGAQPVSIIERWERK---LKRNVSVECPSIISLYNKFMG CinPB2 SGILVTKWYDNNA-VHIGSNFVGIEPMSTIDRWSSE---IKEKVPIQCPQIITMYNKGMG HsaPGBD1 NEIILCRWYGDGI-ISLCSNAVGIEP---VNEVSCCDADNEEIPQISQPSIVKVYDECKE Mmupgbd1p EEIFLCRWHGDGF-ISLCSNAVXIEP---VSKASCV-ADDKEXSFLQVTSIVKLCEECRK HsaPGBD2 EEIIVCRWHDSSV-VNICSNAVGIEP---VRLTSRHSGAAKTRTQVHQPSLVKLYQEKVG Mmupgbd2P QEIIVC-----HV-VNICSNVVGIEP---VRVPSHHPGAAKAQAQVHQPSLVKLYQEKAR HsaPGBD3 KGNIVCRWNDNSV-VTVASSGAGIHPLCLVSRYSQK---LKKKIQVQQPNMIKVYNQFMG HsaPGBD3P3 KGSLVCRWNDNSV-VTVASSGAGIHPPCLVHRYSQNNEZLKKXTQVQQPNMIKVYNQCIG HsaPGBD3P2 KGNVVCR----------------------------------------------------- HsaPGBD3P1 KGNIACRWNDNSV-VTFASSGAGIDHLCLVSYYSWK---QKKKTQVLQPNMNKVYNWFMG HsaPGBD3P4 KGSTVCRWNDNSV-VTIASSGAGIDPLCLVSSYSQK---LKKKIQGQQPNMIKXYNQFMG HsaPGBD5 GNMSLICWYNKGH-FRFLTNAYSPVQQGVIIKRKSGE--------IPCPLAVEAFAAHLS Mmupgbd5 GNMSLICWYNKGH-FRFLTNAYSPVQKGVIIKRRSGE--------IPCPLAVEAFAAHLS TruPGBD5 GSLSLISWYNKGH-FRFLTNSYSPTRQGMIIKRKSGE--------IPCPLAVEAFAAHLS CinPB1 GDLLACAWHDVRR-LTMLSTIHNASSTETTIRSKKVDT---GTRTILKPICVAEYNRHMG CinPB5 GDILCCAWHDTKR-LTMLSTIHDAGVSEKSIRSKTSET---GTRMVMKPNCVTEYNKYMG CinPBD1 --------------VCAKSAVRSSEIKAKSATQKGNKR---SYNDMKKANSKKRYN-YLS TniPB TLVSYKPKPAKMV-YLLSSCDEDASINEST----------------GKPQMVMYYNQTKG BdoPB TLVSYKPKPAKMV-YLLSSCDEDASINEST----------------GKPQMIMYYNQTKG AgaPB3 AICSYVPKKNWAV-VLLSTFHYDTEIQGPK----------------NKPRMIADYNRSKG AgaPB4 SICYYFLKKNKSV-VMLSTMDYDKDVQGPK----------------EKPAMIIDYNKFKG AgaPB5 CLCSYVXKKNKCV-ILMSTSHYDMEITGPK----------------NKPKMIDDYNKLKG AgaPB2 TMCSYIPKKNRSV-LLISTSHYDTKTHGPK----------------KKPTMMLDYNKYKG Pigibaku1 SLVSYVPKKGKNV-VLMSTLHRDGRMCDQEH---------------HKPEIIMDYNATKG Pigibaku2 ---SFIPPKEKQE-CSSSEHTAQIRZHZRSW---------------GQEAIILDYNRNKG Pigibaku3 TVVSYFPKQNKNV-XYIEYNPTDVSLSTRED---------------KKPQTTLDPGQLD- AgaPB9 KSITVLKWKEKQEEVLLLSTKHSFEMMKIECRGSSKR----------KPRIVIDYRRGKA AgaPB10 NGITVIKWKNKRD-VLMLSTKHSDKMVIAKIKNR----------YVLKPKIIYLNSKKKK Pigibaku5 GKLCVVKWFDKKP-VLMMSAVHGTQPEDTCQRWDKIQK------KYVSRPSIVREYLKMG TruPGBD2 GELLFVKWLDARQ-VNMCSTMHKAYSNDTAMRKVKNAKGEWTVKRVPIPGCIKDYNQHMG AgaPB1 TTLTVYQGKTKKNVVLLSSMHRDIRTGNDKK---------------SKPETVAFYNSTKY DmLOOPER1m QPVVICKRWSPKAKAYIDISG---------------------------PAIVALYNKGMC AgaPBD1 PATLVSYVTRRKEVMLLMSSFVDFDSEEQAGEQDEGE---------QHLKLVELYNRTKT TruPGBD3 RGNLVATVTRDLKVVSCLSTNSAPGIVGISPDQREGE-----AHGDEERDSMESSGASYG TruPGBD4 GPLLVTRWRDMKEMGCLSTNAAPGEHDTVWRRSQTKVG---ELDPVHRPLAFRLLQENMR DpuPokey5 CRKGIFVWRDTKA-FRVASNYHGSNLVKVRRKQRDGS-----FKTKSCPKAIDDYVNNMG DmeCG9839 --LMMAKWRRRAKSLYCFSSDCLAIYSKEMAMQKTN----------AKPKLIQELEFQLR OsaPB GQMIAASWMDGSA-VNILSNADSSGMGEVTRMIGKER------VVFPAPKCVAEYNKYMQ AgaPBD3 ----VLVMDGQGK--RILSTIHGAAAMQPTEGEPQGP----------PPACVADLNRHLA DmeCG13151 DAVFCCGLSSQVDAVQAYEQTSEACQQFYEHSQRFSTAHATPAPLKKQINPFLQLLHFVL NhaPB ------------------------------------------------------------ AgaPB6 GIDKSDQMISYATHSR-RSQKWYHKLALYLLTGTSVVNAHIVYQKANNIKIG--IREFRE AgaPB7 GIDKSDQMVSNATHIR-RSRKWYHKLAMYLLIGTSVVNAHIIYQKINNISIT--IREFRE AgaPB8 GIDYSDQMVSYATTMR-EGVKWYRKLGIELLLGTSVVNALVVFKTATKRNIG--IREFRE AgaPBD2 RPDRSDAIGPHITDLR-KGMKWYKQVGLVLLLQVCVTNAWILHRMVTKKKLK--LATFRE BmoPB1 GIDHKDQMLSAYPIERSRNIIWYKKLFR-RLLNVSMHNALVMFN-HNRTHALRHRE-FRL HsaPGBD4 AVDSADQMLTSYPSERKRHKVWYKKFFH-HLLHITVLNSYILFKKDNPEHTMSHIN-FRL CinPB3 GVDQVDQM-ISYYPCHRKSLKWTKKVFF-YFMTISVHNAYILYKSKSSAKSCKTLYSFIL CinPB4 GVDQVDQMKIVYYLCHHKSLKWTKKVFFFYFIKISLYNAYILYKSKSMAKLYKILYSFIL Pigibaku4 GVDLLDMLSALYKFSF-RSRRWYMYIWW-HTVTVAVINAWKFYRRDQKKL-EPQMKPMGL TruPGBD1 GVDALDALIAYHRIHI-RSKKYYHRLFF-HFVDMAIVNSWLLYRRDCESLGVPRRKRKDL CinPB2 GVDLADMLISLYRTEV-KTRRWYIKIFW-HCIDIAKVNAWLLYRRHCNEMSISKKSQRTL HsaPGBD1 GVAKMDQIISKYRVRI-RSKKWYSILVS-YMIDVAMNNAWQLHRACNPGASLDPLDFRRF Mmupgbd1p GVAKMDQXISKYRVGL-RSKKRLWVLVS-YMVDVAMSNAWQLHRICNPGSPLDLPGFQKC HsaPGBD2 GVGRMDQNIAKYKVKI-RGMKWYSSFIG-YVIDAALNNAWQLHRICCQDAQVDLLAFRRY Mmupgbd2P GVDZMDQNIAKYKVKI-XGKKWYLSFTS-YVIDAALNNVWQLHRMCCQDRQGDLLAFRRH HsaPGBD3 GVDRADENIDKYRASI-RGKKWYSSPLL-FCFELVLQNAWQLHKTY-DEKPVDFLEFRRR HsaPGBD3P3 SIDSADENIDKYRASI-HGKEWHSSPLL-FCFELVLQNAWQLYKTY-DEKPIDFLEFGZ- HsaPGBD3P2 ------------------------------------------------------------ HsaPGBD3P1 GIDRADKNFDKYQAAI-HGKNWYSSXLL-FCFKLVLQNAWZLHKTX-DEKPVDFLECRWR HsaPGBD3P4 VIHTADENINKYQASI-CGNKZYXSPLL-FCFKLVLQNAWQLHKAY-DEKPVDFPEFHRR HsaPGBD5 YICRYDDKYSKYFISHKPNKTWQQVFWF--AISIAINNAYILYKMS-DAYHVKRYSRAQF Mmupgbd5 YICRYDDKYSKYFISHKPNKTWQQVFWF--AISIAVNNAYILYKMS-DAYHVKKYSRAQF TruPGBD5 YICKYDDKYSKYFIFHKPNKTWQQVFWL--SISIAINNAYILYKMS-DAYAVKRYSRAQF CinPB1 GVDRMDQRMKTYIFPHRSHKWYMRIYDG--IISIAMVNAHIISFSCPSSSNKKPKSLKQF CinPB5 GVDRIDQRIRTYLFPHRSRKWYMRIFDN--LIQICLVNSHVIYNTLPSGSNEKKLTLKFY CinPBD1 GVIPIFRQLN--LFRHKTVKWSLRIFEN--LAQICVVNSYILYTSKTSDSSDK-MDLKKY TniPB GVDTLDQMCSVMTCSRKTNRWPMALLYG--MINIACINSFIIYS-HNVSSKGEKVQSRKK BdoPB GVDTLDQMCSVMSCSRKTNRWPMALLYG--MINIACINSFIIYS-HNVSSKGEKVQSRKN AgaPB3 GVDNMDKCLFEYSCKXEDKSVAISIFYN--ILDVAAFAAYKIYKENNPNLYNAI-NYRRL AgaPB4 GVDNMDKYLSEYSTKRKTNRWPLAFFFN--ILDRAAFAAFKIYKENNLQNCQST-DYRRM AgaPB5 GVDNMDKYLSEYTTKRKTNRWPLAFFYN--LLDVAALAAFVLYKENNPQYNTSP-NKRRM AgaPB2 GVDTMDQCLAHFTTKRKTRRWPLAFFYN--ILDIAAYAAYITYMGNNPHFNSTN-YTRRV Pigibaku1 GVDNMDKLVTAYSCKRRTLRWPLVIFFD--MLDISAYNAFVIWMALNPEWKRVKLQKRRL Pigibaku2 GVNNLDKVIGTYSYRSMTAHWPLIIFHN--IIDVSSYNAFVIWREINPSWMSRKQNKRRV Pigibaku3 ------------------------------------------------------------ AgaPB9 AIDLADR-MNAYSLTLCKAMQWYRKLGFDLLLNTALANAYLLYKDATNKQVSISEFRKEL AgaPB10 N----------------------------------------------------------- Pigibaku5 GVDLIDRMISYYCMSTRTKKWTMRMLMH--FTDLALANSWLLYRKDLTTZDAPRKSIMQF TruPGBD2 GVDLSDALISYYNVLHKTLKWYKTLFYH--FVDIATVNAFILHKEMCKLQDRPELKQKAF AgaPB1 GVDVVDQMCRKYSLKSASRRWSVHSFFN--ILDLAGINAWVLYKELTKENISRRDFLFKL DmLOOPER1m GVDLADMMMELYKINNRSTFFIVAWEYSLQKLRYRIGNNSSZZPQNKNIFSLSNFNRKLP AgaPBD1 TIRTIQQMCAKHNVVRSTRRWPVAVFFN--LMNLSAINAWCIYCLNHPEEAKMSRRDFLV TruPGBD3 HAATFAPAAVPGEHEGRRPLRPAEGVLPGGPGRARSGGATSCGSTSTCASSTPTSSSGRA TruPGBD4 GVDICKQLLACNPLGGIPQDKHWRNLFW-FLVNLSIVNAFIMLRESRKDSPPPWVQDGLF DpuPokey5 GVDTANQLRSYYERDRKAKKWWHRLLYS--LLETCLVNSWICFNDMVRSQMAEIKTSNTQ DmeCG9839 PGNDGRHHLIHYQAACKELKANIKLTIF--LLNILVYNAYLLYFANGQNARVGHLKSYSE OsaPB GVDRLDQLRAKYSLADGHSMQKWHKKLALAFIDIARVNAYVTKCLRDDKPLRNQHRQFMI AgaPBD3 DLERFEGLLVEEYLSNASVGWHIRTVLL--LINVALLNAYILFSQTDTGSRFTFNVFRLA DmeCG13151 NAAAVNAWILLRLSPKGDAAMDQRDFQR--QLGLFLTQQRLQRRLQRRSTSTSLVMRLQI NhaPB ------------------------------------------------------------ AgaPB6 KIVHEWLCSEYPDIEE--------------------------ENNKNNHYLQKRKNSSNK AgaPB7 LVVQEWLC------------------------------------------LENLKPTPN- AgaPB8 MIASELLQLPVKNTTK--------------------------XSATRKSCFSHPSRFQWE AgaPBD2 QLVDQLVPLPNPTVERGLS----------------------GGEKKYTHHLEVRTDGNGR BmoPB1 QLAKQLLQSSRSAAPSRS-----------------------LAPAARPEPAACIRDMHLP HsaPGBD4 ALIERMLEKHHKPGQQHLR----------------------GRPCSDDVTPLRLSGRHFP CinPB3 TLVSQLCQQDRLQPQIDDE----------------------NLAGPPPKSPRIDSTKRLK CinPB4 KLVSQLCQQDRLQAEVDDD----------------------TVAGPPPKSPRINSSNRLK Pigibaku4 RRFQALVGTSLTSAGKTKIKCGRPPSSPEAT---------ATPPRKRPSCSVP-LDMRRD TruPGBD1 LAFRASVAQALCMEGKDPMRQKRGRPSLDVDG------QFEIKKRRGPAKAIPPQEVRSD CinPB2 LNFVVDISDNLLYRNSCSTP-TRGRPSNKRKL------ENDTLPGKKPFTPTPNEILRFD HsaPGBD1 VAHFYLEHNAHLSD---------------------------------------------- Mmupgbd1p VACFRLGHDANLSD----------------------------Z----------------- HsaPGBD2 IACVYLESNADTTS----------------------------QGRRSRRLETESR---FD Mmupgbd2P VASGASGEQXQTSS----------------------------QGRRSWRVETESR---LD HsaPGBD3 VVCHYLETHGHPPE----------------------------PGQKGRP-QKRNIDSRYD HsaPGBD3P3 --CHYLETHGHPPE----------------------------PGRK-------------- HsaPGBD3P2 ------------------------------------------------------------ HsaPGBD3P1 VVCHYLQTHGHPPE----------------------------PGQKGRPSQKHNIDSHYD HsaPGBD3P4 VVCHYLKTHGHRLK----------------------------PGR-KRPSQKHNTDSYYD HsaPGBD5 GERLVRELLGLEDASPTH------------------------------------------ Mmupgbd5 GERLVRELLGLEDSSPAH------------------------------------------ TruPGBD5 GERLVRELLELDDCSPTQ------------------------------------------ CinPB1 IEEIASELLNGYTSARKRAGK---------------------QQSP-LHFKRLIPFQHQH CinPB5 IQECITGLLQEYTPG-VLSPR---------------------RKSK-DTISRIVPDQYYH CinPBD1 IEACVSGLLVDYNPHITEKWR---------------------PPQPGTVLSRILPPQYVH TniPB FMRNLYMSLTSSFMRKRLEAPTLKRYLRDNIS------NILP------------NEVPGT BdoPB FMKNLNMSLTSSFMRKRLEAPTLKRYLRDNIS------NILP------------NEMPGT AgaPB3 FLKDLCEQLCTKEIQRRSENTQIMRHFGPRSG------VESMLGQSLASTLRQHVDAYSE AgaPB4 FLQQLSEQLTMPVIQRRSENVQLMRHFGPRSG------VESMLGGPLIALSKKNTTKDVE AgaPB5 FLQQLCEQLAMPEIEIRSTDIQIMRHFGPRSG------IEAMKGGPIKSP--DTNETMTP AgaPB2 YLQQVAEQLGMDEIVSRSQNAQIMRHFGPRSG------IESMLGKPINPV--VVNVPHVS Pigibaku1 FLEDLGKALVRPQIERRKHIPRTPASAAMVRR------IQKENAGALSTQPTEPQSAEPE Pigibaku2 FLEQLGKALATPLIERRKHVPRTEASAAVVKA------IQS--AGAP-DQPEVPATTATS Pigibaku3 --------------------PQQHPSAIIGKV------KLR--------------STSSG AgaPB9 TVHLTQFYPAETIDP-------------------------------LSMVETMIGFKTQH AgaPB10 ------------------------------------------------------------ Pigibaku5 LEFRVEVARTFLAQQYSQEDDADFPELSEGEDD-----STQGKRRPVMAVPHVSVRRRAN TruPGBD2 REQLILSLAGIGSTPRRSAPQNHPGLAVAAPAAPSSSQVPDTTPPTAPASSHLPAYFVEH AgaPB1 GEELAEEYVENKSAN--------------------------------ANLPMTNAGGSRR DmLOOPER1m MNFYIPLALLHLKKETSKNKZ------------RTRKLSSIIGIPKQCLFASIKEVQIFD AgaPBD1 TMALELLRPQARRRLDSKTLPR--------------------LLRQRIGLFLGISREEYE TruPGBD3 EGARRPPGFNGKQFTQRHFRVRLAQQLIGDYQG---------ARGMERAARKRHADSPVE TruPGBD4 TQVIFRKRLGNQLAKCGQKYLD-------------------PGEMARSRTSIGPTEELVK DpuPokey5 ------------------------------------------------------------ DmeCG9839 FRVIIIKSLLREEVTNEPVTSIQKPETYERSK-----------NKPVPEPRLKTILHEPM OsaPB ELASELITGKWNDTVENEGMVFADDQLSTTSR-----STTGYPKAPSTVASPTPPCDVVL AgaPBD3 VAREWVGASEPLEEP--------------------------------------------- DmeCG13151 CEILGQSSQRLLSEATG-----------------------EAKLTHSVGVLTPDKMSLPL NhaPB ------------------------------------------------------------ AgaPB6 TLRRMCVNCYIKMLQCSSRKDVHRNAKVHNNVLWQMAKYTSNVHELFQRVPLMLFEQLWC AgaPB7 DIVENFVDNYVVEETFVPAACMEENGSEKCYV---------------------------- AgaPB8 KMRRACKRCYNNDRQSMGRSKVRETVKRSFTNCPSCPDQPQLCDECFKIVHQK------- AgaPBD2 TVRRSCANCYAESRKTMSHYEAGRNKKATTTFCGSCPKQPQLCMPCFNKLH--------- BmoPB1 -------GKNTKKQRCKLCYSAKVQR-------STVWRCTLQCHLCIV------------ HsaPGBD4 KSIPATSGKQNPTGRCKICCSQYDKDGKKIRKETRYFCAECDVPLCVVPCFEIYHTKKNY CinPB3 G---------GFKKHVIALYPPTKKKAAAQRPCRACMKNGCRKDTILL------------ CinPB4 G---------GFKKHVIVLYLPTKKKTAAQRRCRVCMKNSCRKDARYYCAYY-------- Pigibaku4 GIDHFPTWET-RQRCKHCTGNHFSHVYCEKCKVHLCLNKEINCFSAYHKVK--------- TruPGBD1 AVGHWPVVENGRQRCKLPNCKGQTVYKCAKCNVHLCLNKVNNCFCEFHK----------- CinPB2 QISHWPEPRSQRGRCRLCKS-GYSQIYCSKCHVCLCLKSSNNCFKEFHCKN--------- HsaPGBD1 ------------------------------------------------------------ Mmupgbd1p ------------------------------------------------------------ HsaPGBD2 MIGHWIIHQDKRTRCALCHS--QTNTRCEKCQKGVHAK----CFREYHIR---------- Mmupgbd2P MIGHWIVHQDKRIPCALCHS--QTNTRCEKCQKGVHAK----CFQEYHFP---------- HsaPGBD3 GINHVIVKQGKQTRCAECHK--NTTFRCEKCDVALHVK----CSVEYHTE---------- HsaPGBD3P3 ------------------------------------------------------------ HsaPGBD3P2 ------------------------------------------------------------ HsaPGBD3P1 GINHMIVKQGKQTRCAECHK--NTTFRCEKCNVALHLK----CSVEYHTE---------- HsaPGBD3P4 GINHGIVKQGMQMWYAECHK--NNTFQCEKCDVTLHVK----HSVEYHTGQ--------- HsaPGBD5 ------------------------------------------------------------ Mmupgbd5 ------------------------------------------------------------ TruPGBD5 ------------------------------------------------------------ CinPB1 FLGK--TTRKSCQCCN--------KQTMTLCKKCNVSLCALDCFERYHSLQEYRMK---- CinPB5 KLIKEESSKPNCAVFF--------LSVZANTRDYPNDLKCKQAIRGKSREKDFWYICLEI CinPBD1 KIIK-IDKKPQCVVCSDSRRKLGRRQTSFMCEKCNVALCVVPCFHRYHTLKNYRVCHLDM TniPB SDDSTEEPVMKKRTYCTYCPSKIRRKANASCKKCKKVICREHNIDMCQSCF--------- BdoPB SEDSTEEPVTKKRTYCTYCPSKIRRKATASCKKCKKVICREHNIDICQSCF--------- AgaPB3 EIRDASG-RLKHKGNCYICKKRRSTRKSCGKCEKPVCASHSSNRIYCNQCK--------- AgaPB4 E-RDVSG-RIKHKGNCYLCVKKRSTRKSCSTCKKPICTLHSVIKTSCKPCD--------- AgaPB5 TKRDASG-RVKHTGTRFLCVKKRPTRKVCDZCKKPVCTQHSKIITKCDHC---------- AgaPB2 EERDVTG-RIQQKGKCHLCVKRRATRKECSLCCKPVCVEHSSNKVVCKNYVSTTNT---- Pigibaku1 VNVZXVVNSSNKKKRCEVCGPKMDRKTQYTCIKCKKYICNTHTVKLWPSCVV-------- Pigibaku2 PAR------ASKRKRCQFCPQKKDCKPHTVCCKCKKYICKSCALAYCPTCAN-------- Pigibaku3 HRZ-------KEGKRCQVCPSREDNKTSTSZLNFKNYICR-PTVTFCPSCGEQZ------ AgaPB9 YFERKPGVTHTVRRYCKQCYAENVARLGRTKSKIVTKKVATYCRNCEG------------ AgaPB10 ------------------------------------------------------------ Pigibaku5 AHLPEMISLKNAARCRAAGCTGRTRVRCVTCKVFLCLQTELNCYAAFHTZ---------- TruPGBD2 MNDVTPRFRATLGRRTCVLCKRKSPVYCSTCKKTLCFTSLRNCYRDWHRSNSICT----- AgaPB1 RYKVQTSCHEGKSANECFTCNRPVCKKCTKRISYVCVSCEPGSDEAM------------- DmLOOPER1m KSYXEHWVVFGERGRCRLCKTATPMTKCLTCKVHLCCNNNKNCFFVIPHLNCHYKEKYFI AgaPBD1 TVPVVERQGGESRGRCYLCGRARNKTTRISCHSCGKYTCNAHCAQLCRTCYMDDCASEQQ TruPGBD3 YGHRLERMSERSRRCRNCTNKGLRHESVFGCKICNVHLCRGGCFSEFHK----------- TruPGBD4 ERHRLAKISTFSKRCKNCNLKNLRHESVYGCSTCGVNLCKQPSCFWEFHGLPPLHKGCN- DpuPokey5 ------------------------------------------------------------ DmeCG9839 LIQQNGKPAKKNCRYCHKGGMLQFSRYMCNTCPDKPGLCQEPCFLLWHEQLKKVIRQTIG OsaPB SLTRFPEATRGKRGCKVCMFEGRTWTMKTLYCIRHNVCLCTKSYSLNQSLADVVCPHTDW AgaPBD3 --TKFLPLIRGRKRKFLPLIPGRKRKETGLHNRVPKHPARN------------------- DmeCG13151 GINLASRYGEKHRRCKPCARNKRGTKSRTRCQQCLQHRCGNHLISRCYECVGILPGQLPE NhaPB ------------------------------------------------------------ AgaPB6 --------------------- AgaPB7 --------------------- AgaPB8 --------------------- AgaPBD2 --------------------- BmoPB1 --------------------- HsaPGBD4 --------------------- CinPB3 --------------------- CinPB4 --------------------- Pigibaku4 --------------------- TruPGBD1 --------------------- CinPB2 --------------------- HsaPGBD1 --------------------- Mmupgbd1p --------------------- HsaPGBD2 --------------------- Mmupgbd2P --------------------- HsaPGBD3 --------------------- HsaPGBD3P3 --------------------- HsaPGBD3P2 --------------------- HsaPGBD3P1 --------------------- HsaPGBD3P4 --------------------- HsaPGBD5 --------------------- Mmupgbd5 --------------------- TruPGBD5 --------------------- CinPB1 --------------------- CinPB5 TIZ------------------ CinPBD1 --------------------- TniPB --------------------- BdoPB --------------------- AgaPB3 --------------------- AgaPB4 --------------------- AgaPB5 --------------------- AgaPB2 --------------------- Pigibaku1 --------------------- Pigibaku2 --------------------- Pigibaku3 --------------------- AgaPB9 --------------------- AgaPB10 --------------------- Pigibaku5 --------------------- TruPGBD2 --------------------- AgaPB1 --------------------- DmLOOPER1m FCDL----------------- AgaPBD1 E-------------------- TruPGBD3 --------------------- TruPGBD4 --------------------- DpuPokey5 --------------------- DmeCG9839 RSE------------------ OsaPB TSWQKYNDYYLPNGIFDEHGR AgaPBD3 --------------------- DmeCG13151 GNMVDEGAT------------ NhaPB --------------------- biococoa-2.2.2/Tests/Test-BCFoundation/DataFiles/transposon.fasta000644 000765 000024 00000067525 10675026741 025400 0ustar00scottcstaff000000 000000 >TniPB MGSSLDDEHILSALLQSDDELVGEDSDSEISDHVSEDDVQSDTEEAFIDEVHEVQPTSSGSEILDEQNVIEQPGSSLASN RILTLPQRTIRGKNKHCWSTSKSTRRSRVSALNIVRSQRGPTRMCRNIYDPLLCFKLFFTDEIISEIVKWTNAEISLKRR ESMTGATFRDTNEDEIYAFFGILVMTAVRKDNHMSTDDLFDRSLSMVYVSVMSRDRFDFLIRCLRMDDKSIRPTLRENDV FTPVRKIWDLFIHQCIQNYTPGAHLTIDEQLLGFRGRCPFRMYIPNKPSKYGIKILMMCDSGTKYMINGMPYLGRGTQTN GVPLGEYYVKELSKPVHGSCRNITCDNWFTSIPLAKNLLQEPYKLTIVGTVRSNKREIPEVLKNSRSRPVGTSMFCFDGP LTLVSYKPKPAKMVYLLSSCDEDASINESTGKPQMVMYYNQTKGGVDTLDQMCSVMTCSRKTNRWPMALLYGMINIACIN SFIIYSHNVSSKGEKVQSRKKFMRNLYMSLTSSFMRKRLEAPTLKRYLRDNISNILPNEVPGTSDDSTEEPVMKKRTYCT YCPSKIRRKANASCKKCKKVICREHNIDMCQSCF >BdoPB STRRSRVSALNIVRSQRGPTRMCRNIYDPLLCFKLFFTDEIISEIVKWTNAEISLKRRESMTGATFRDTNEDEIHALFGI LVMTAVRKDNHMSTDDLYDRSLSMVYVSVMSRDRFDFLIRCLRMDDKSIRPTLRGNDVFTPVRKIWDLFIHQCIHNYTPG AHLTIDEQLLGFRGRCPFRMYIPNKPSKYGIKILMMCDSGTKYMINGMPYLERGTQTNGVPLGEYYVKELSKPVHGSCRN ITCENWFTSIPLAKNLLQEPYKLTIVGTVRSNKREIPEVLKNSRSRPVGTPMFCFDGPLTLVSYKPKPAKMVYLLSSCDE DASINESTGKPQMIMYYNQTKGGVDTLDQMCSVMSCSRKTNRWPMALLYGMINIACINSFIIYSHNVSSKGEKVQSRKNF MKNLNMSLTSSFMRKRLEAPTLKRYLRDNISNILPNEMPGTSEDSTEEPVTKKRTYCTYCPSKIRRKATASCKKCKKVIC REHNIDICQSCF >AgaPB1 MFISDKESTCQGPGRKHTYVADIGTGPSKETCRASSTRQATDSNAGRTPRVVPAKSKKDQVDIQSKEAAKTNRTLEGSLG KLAVGSVVEAPDGTQWKVVEVNNANGGIVAEVNVIRDVPGPSAYAKRYVVAGAVSSSWRLIIDNGILNQIRKCTEIEARR VLQTKNWTLSFAELEAFLAILYIRGATESKGMEIDLMWSEKYGLPFCKNVMSRNRFREIMKFLRFDEKSTRSQRLQTDKF ALISDVFSRFVSNCQTNYVPGPHISVDEQLFPSKTRCPFTQFMASKPDKYGQKYWMAVDVDSKYVVNIIPYLGKNDERPA EERLGDFVVKKLVDPYLNRGRNVTCDNFFTSLELAKFLKSKKTSLVGTINKARREVPICVKKVKEKLYFTKAFKSDDTTL TVYQGKTKKNVVLLSSMHRDIRTGNDKKSKPETVAFYNSTKYGVDVVDQMCRKYSLKSASRRWSVHSFFNILDLAGINAW VLYKELTKENISRRDFLFKLGEELAEEYVENKSANANLPMTNAGGSRRRYKVQTSCHEGKSANECFTCNRPVCKKCTKRI SYVCVSCEPGSDEAM >AgaPB2 MTDIEWLELSPAELESLSDADKLNYRQKILDELTEQVVGYLEEDDIASIANFDDSDVEDIEIPQYDYDETDDEDFDEEYE LENAPESYTARDGTIWTTQPPPLRKILMHNVIKDNLASHLKNKSDKDKSAVDIFKLFFSTPICEIVIRETNRKADQFCAN YNASHPDSNIQWQPLTPSELDAYIGILIEAGVTHSNDLALEELWKTNSHPLFRASMGLKRFISITRFIRFDNGSTREQRK KTDKAAAISQIFGILNTNLNSCYKPRNNLTIDEQLFPYRGGTGFTQYIPSKPAKYGIKIWWICDSESSYPLKGQIYTGLS PSGEREKNQGERVVKDLCHQFRRSGRNITCDNFFTTFNLAKTLMQDYKLSILGTVNKRRTFVPFELMVTKGRETESTKFV FQNNVTMCSYIPKKNRSVLLISTSHYDTKTHGPKKKPTMMLDYNKYKGGVDTMDQCLAHFTTKRKTRRWPLAFFYNILDI AAYAAYITYMGNNPHFNSTNYTRRVYLQQVAEQLGMDEIVSRSQNAQIMRHFGPRSGIESMLGKPINPVVVNVPHVSEER DVTGRIQQKGKCHLCVKRRATRKECSLCCKPVCVEHSSNKVVCKNYVSTTNT >AgaPB3 MADIEWLTPEELSMMSESQKSAYERKMCDFLRNSEDCEVESIYNDEEDQSIFVLDNICDSDAEEIQLPEYNASDSDNDDD FEEAIDPSNSYKARDDTFWHSQPTVPRKILSHNILRSPSSGPTKKTKSLSIMNTFKLLITPEICDIIIRETNRKAKQTLE KLQTENPTAQSRSWNPLTTNEFDAYLGILLEAGVTCSNHVHAADLWKTNSHPLFRASMSLNWFWVINRFIRFDDSRTRTE RKKEDKATAISGVFGMLLKNLQSCYIAGMNVTVDEQLFPYRGGTGFTQYIPSKPAKYGIKLWWACDAEPSYPINGQIYAG LSPSGIREKNQGERVVKDLCRVFRGSGRNIICDNFFTSYNLAISLMEDYKLALLGTVNKRRTFVPSSFSNPKGREVLSTL FGFSENVAICSYVPKKNWAVVLLSTFHYDTEIQGPKNKPRMIADYNRSKGGVDNMDKCLFEYSCKXEDKSVAISIFYNIL DVAAFAAYKIYKENNPNLYNAINYRRLFLKDLCEQLCTKEIQRRSENTQIMRHFGPRSGVESMLGQSLASTLRQHVDAYS EEIRDASGRLKHKGNCYICKKRRSTRKSCGKCEKPVCASHSSNRIYCNQCK >AgaPB4 MEEIEWLTPEELSNLTEEERTAYTQQKIHEFMEYGSEDENMISAVVEEDEIPVFDQVIIDSDAEEVQLPEYNPLETDSDD DYAESFQLSSATYKTHDGTIWSSQPTIPRKILAHNILRSSQSGPTLKTEGLSIIKTFKLLMSDEMIDIIVRDTNRKAQQI YEREQVTNSGKSASMHTWKTLTKSEFEAYLGILLLAGVMRSNYVHSTELWKTSSHPIFRATMSLQRFRSINRFIRFDDRR TREVRKKMDKSAAISDIFAMLNRNLQACYVAGSHVTVDEQLYPYRGGTGFTHYIPSKPAKYGIKMWWVCDAVTSYSIKGQ IYTRLAPSGQRERHQGERVVKDLCRIFRGSGRSVICDIFFTSYNLASSLMPDFKLALLETVNKRRTFVPPMFANPHGREI QSTLYGFSENISICYYFLKKNKSVVMLSTMDYDKDVQGPKEKPAMIIDYNKFKGGVDNMDKYLSEYSTKRKTNRWPLAFF FNILDRAAFAAFKIYKENNLQNCQSTDYRRMFLQQLSEQLTMPVIQRRSENVQLMRHFGPRSGVESMLGGPLIALSKKNT TKDVEERDVSGRIKHKGNCYLCVKKRSTRKSCSTCKKPICTLHSVIKTSCKPCD >AgaPB5 MESNDWLSIQQLDELSLEERERYNQQRLQEMAEEGSDEEVLLFPSTGEDQNDCLVSGALNDSDAEELQVPEYNHIQXDSG DEYSEEWLDEYTAEEYKZKNGTVWSSEHPGNTHKILAHNILRZKNTGPXKTKVLSIVHTFKQLVTEEMCDLIFRETNRKA ILCFQNSNESDRVHSKDWKPLTSSEFDAYIGLLLLAGVXYMPVTELWKTSSHPMFRASMSIQRFWSISRFIRFDNGQTRQ QRKTMDKAAAISDVFQMLYANLKSCYVPGTNVTVDEQLFAFRGGTGFTQYMPSKPAKYAIKVZWVCTLZKAKYIQAWQYQ VNRZLYNLSYSLKKLREIZCFLFFFLFKTSGERERNQGERVVKDLCDMFRGSGRNVVCDIFFTSYNLALSLMLDYKLSIL GTVNKKRTFVPAFFVKPKGRIPESTLFGFSENVCLCSYVXKKNKCVILMSTSHYDMEITGPKNKPKMIDDYNKLKGGVDN MDKYLSEYTTKRKTNRWPLAFFYNLLDVAALAAFVLYKENNPQYNTSPNKRRMFLQQLCEQLAMPEIEIRSTDIQIMRHF GPRSGIEAMKGGPIKSPDTNETMTPTKRDASGRVKHTGTRFLCVKKRPTRKVCDZCKKPVCTQHSKIITKCDHC >AgaPB6 MNTHTDFDTHMDLETLTDLDTHTDIYSDTDTDTDTNVSYDSDQLDEILKELADEEEKEESNIELPSSLETINFTEFLGGQ KTFQFTGKGGLKTSHYKNITPGESLSLFINDSVLKLIATETNNYAHKKYANGTKNKHARGNYWTPTNEHEVKKIIGILIW LGFFQFPLEKYWSESPIFNFSFLKKLISRQRFQLIMSNFHLSDNERIESPTRLDKISPLVQLLINNYQAVYTPGKDIVID ESMVPFKGCLIFKQYIPTKAHKYGIKLFKLCCNEGYTWSMKVYAGKNDKEKTKLGVGTNVCFELAEKLMNEGRTLYIDIF FTSYELALKFLQNKTHVVGTLRFNKKYMPKEVMVSKLKKGEMISKEDPNGIVVLKWRDVRDVRMISTKHAPVLVSTTSAS KPQRTEKLKPVAVIDYNQGKCGIDKSDQMISYATHSRRSQKWYHKLALYLLTGTSVVNAHIVYQKANNIKIGIREFREKI VHEWLCSEYPDIEEENNKNNHYLQKRKNSSNKTLRRMCVNCYIKMLQCSSRKDVHRNAKVHNNVLWQMAKYTSNVHELFQ RVPLMLFEQLWC >AgaPB7 MDTNTEIHPALSSNMETDSNTDMDTEVSYNSNELEEILKEIAEEEDMEEEDVELAPSLDAIQWSEFSGRQKSFEFTGKEG IQIEHSGKITAEESLSLFINNDILKLIANETNKYAEAKYTRIIEKHARGNSWTPTNEGEIKKLLGILIWMGFHQLPMKKC WSTNEMYNFSFLRNIMCRIRFELLLSNFHLADNSTDSQNRLYKIAPLIEMLLQNYQTIYTPGKDIVIDETMVPFKGRLIF KQYIPSKAHKYGIKLFKLCCTEGYTWSLKVYAGKNNMCKTKMGLGSNISVELANNLMHEGRTLYIDNFFTSYELAIQCLK KSHVVGTLRYNKKYMPKCVMDKPLKKGEMVSREDPNGIVVLKWKDSRDVRMISTKHVPRLMPVKSAKNPKSKEKMKPLAV IDYNLGKCGIDKSDQMVSNATHIRRSRKWYHKLAMYLLIGTSVVNAHIIYQKINNISITIREFRELVVQEWLCLENLKPT PNDIVENFVDNYVVEETFVPAACMEENGSEKCYV >AgaPB8 MFEANMPKLIEAQSGDEEDIRIPKKNTRNRIVSSDSESDNYDGSDCDCDESSLPDVFREMELEEERNHEGLPQQKSTIQS TAWSEFTGRQKSFAFVEENQLSLPPLDMTPYNVFQLFVDQEIIEMIVTQTNKYALQKLDNATLSQGARMSKWKPTNSAEM KKFLSLLLWMGLVKVNPVVNYWSKNTLYNFKLPSTVMSRNRFEILLSNLHFTDNTSISPKNRQGKIINLMDKLQEKYQKV YTPGENIVIDETLIPWRGRLIFRQYIPSKAHKYGIKMFKLCSSEGFTWASKIYSGKSSEGIRETGLAHVCIKLAEKLFEK GRTLYVDNLYTSYELALTCLDRKTHLVGTLRHNKKSMPRDVLDCKLKKGEMIXVGIVVLKWKDSRDVRMLSTKHAPYMVQ TTKKCYSNQPATKLKPLTVVDYNKGKCGIDYSDQMVSYATTMREGVKWYRKLGIELLLGTSVVNALVVFKTATKRNIGIR EFREMIASELLQLPVKNTTKXSATRKSCFSHPSRFQWEKMRRACKRCYNNDRQSMGRSKVRETVKRSFTNCPSCPDQPQL CDECFKIVHQK >AgaPB9 ZSCALSWKLVTRPASPGKRPSGFVASSSDLTIPASYDRFVSDHLFEKIATQTNLHAVAQSRCPNPSPEAWVATDQQEIKR FFGLTWYDCXPPLRLYWSDDPAYVQTFPKSAMSGERYAHLLHMIVFCNXSSQEQLNRPFLSKIQPLVDTLQANFKKHFVP TEEEDIAVDESLIPGXRGRTAFRQKQPQYAQQGGNKVFKLCCGTGYTYALRVVCTKKAQNESTTDDVIVSLCEALFNGGH TLYTDSRYTSLSMATKLLTKRLHLVGIFNPGRPGNPPAVVSKQLAAGETFAMEKSKSITVLKWKEKQEEVLLLSTKHSFE MMKIECRGSSKRKPRIVIDYRRGKAAIDLADRMNAYSLTLCKAMQWYRKLGFDLLLNTALANAYLLYKDATNKQVSISEF RKELTVHLTQFYPAETIDPLSMVETMIGFKTQHYFERKPGVTHTVRRYCKQCYAENVARLGRTKSKIVTKKVATYCRNCE G >AgaPB10 MLEEQEDTDFSSFGFVVPRRKQRRVLRFFYQLKMKKLVSEKNIQQFKKNGSNRNETMXSFTHFASTFGAKTNIEKVRNCR TVQDFYSLLVTHZIFEYISEQTNIYAAQSNNSSNRSKKWYPTNKDEIKKLFGLPIWMGLVKLPEIRLYWSTKPIYAQSFP RKIMSRDRFEILLKMLHFSNNELEVKSDRLSKVSYIIKALNQNFQKYYDPPETVSIVESLIPFRGRIVFRQYLKNKRHKY GTKIFKLCFGYGYTYNCSFYAGKIHEKEKTTPVNVVMKLSEKLLDKGHTIXAQTIGTLYELYEAIEKIIRKKLKVGEFIA KENSNGITVIKWKNKRDVLMLSTKHSDKMVIAKIKNRYVLKPKIIYLNSKKKKN >AgaPBD1 MGDAMHVQWLSEETEEVPENEEDMLYEDVEYIEEYVHFPDGPESNVSGSVAVQNEESTGHVIKIESIDHAFDMLQNSVWS IKPPERTGTMGRKVAHPRPAPVGLAKSAKSPAECLSLFLDADVIAMITEYTNEQIKAEQPNYARERDANPTDEMEIMALL GVLYIAGTVRDGRENIERLFDTKMGTGLEAVYLTMTSLRYHFLIRSIRFDDPTAAPDEIEGDKLAPIRPIYERIVSNCQK YLRPGRFLMLDEQAVQFKGKCEFRQILPSAPGRAGFRFHLLVDCETSYVSNLEICVPENQNPYNLSYAPTDVAMRLTEPV QGRQKTVILGAGLTSIDLIEKLYASRTMAMGEVPKSYPDLPKALIANKGRPEHSTLAAYHDPATLVSYVTRRKEVMLLMS SFVDFDSEEQAGEQDEGEQHLKLVELYNRTKTTIRTIQQMCAKHNVVRSTRRWPVAVFFNLMNLSAINAWCIYCLNHPEE AKMSRRDFLVTMALELLRPQARRRLDSKTLPRLLRQRIGLFLGISREEYETVPVVERQGGESRGRCYLCGRARNKTTRIS CHSCGKYTCNAHCAQLCRTCYMDDCASEQQE >AgaPBD2 MADNLNNIPNCFPNNEDSSSDSDHDAKSDESDMENNIEEVMQASIMEELDEDSQEQATGRCVNALEARSSWKPWAGKQKP FPFFRKKRLRVDLPAKSTPYEIFSLILDDKLVAHIALAMNLYMEKKNAQKSKASKWLETNPKEVRKFIGLMIWMDLVRVG RLEDYWSESALYNFAVPRAAMYRERFRALLGAFCFYDDGTSKTDYKEPGKIGAFIDVLQSKFQALLHLGEDVVVREMLAL GRDRTSFKQYIPASAHRHGRWALFKLCSLEGYTWGLKLCTEQRLIGEAQLANSVCMELCEPLLNQGRTVYIDNFHASFDL AQALLANQTHLVGTVRVNGSSMPKDVLLAKLRKGEIIARENDDGVMVLKWKGTCTMGLLSTKHSPALVPMESQVRSNRRW IRVARIQPEAVIAHIQAKGRPDRSDAIGPHITDLRKGMKWYKQVGLVLLLQVCVTNAWILHRMVTKKKLKLATFREQLVD QLVPLPNPTVERGLSGGEKKYTHHLEVRTDGNGRTVRRSCANCYAESRKTMSHYEAGRNKKATTTFCGSCPKQPQLCMPC FNKLH >AgaPBD3 MFPLPSNCDPVFTMAALGPYVVIEPLDSEYVVNDTGPAACAEATPNTDGGGEPEQQSDDDDLICLWEEPQTFGIFDEPVG TNVPFDGADERTASEYAALVCDDALFDILVKGTNRHRKQWADCMRAGGQSVEPYRKVTVAEMKRYVGLLLVMGQVRKDCQ HCYWSTNPLLETPVFANTMSYKRFQQISHYFHGMKQANRTYDAKPVLDHLVPKFQALYAPKQQLIVSELTIPQDVLNGQQ TEPPNHSEDAQGSTPESAKRLRLLCESDTGYVLNVELANQQLDQVALTDVSIVRPYFGRWHHVYWGNDGITVAAAETLYA NQTLACGTLRNDPDGTVAPERKSPVLVMDGQGKRILSTIHGAAAMQPTEGEPQGPPPACVADLNRHLADLERFEGLLVEE YLSNASVGWHIRTVLLLINVALLNAYILFSQTDTGSRFTFNVFRLAVAREWVGASEPLEEPTKFLPLIRGRKRKFLPLIP GRKRKETGLHNRVPKHPARN >BmoPB1 ADIIAYIVRETNRYGAQLIRSTIPSKPNSRLSRWKDVTSDEIYGFXVLMLQSLVIDYVEREYWYAVIEELQIGNFKEIMT YNRFIVIKRCLHFIDNATLPVPPTKLDKIIPIIEHLNKKFKSLYVLEQNIAIDESLLLWKGRLSFAQKIATKRPRVGIKS YELCESRTGYLWQMEVYTGKGHAHVVQDGEPEERGQESDEPESATAQIVLNLTRPLFDKGHTLIMDNFYNAPLLSRILKV QHKTDSMGTLRLNREFVPEALKKKTKKNMKEGEVAFSTTKDLSVVVWMDKNIVAMISSFHPIEVGGIEKYGYYRYKPQVV LDYNFSMGGIDHKDQMLSAYPIERSRNIIWYKKLFRRLLNVSMHNALVMFNHNRTHALRHREFRLQLAKQLLQSSRSAAP SRSLAPAARPEPAACIRDMHLPGKNTKKQRCKLCYSAKVQRSTVWRCTLQCHLCIV >Pigibaku1 MAKRNSAQRALELILEDREVFDDDVEGEDSEEEVSEFEDHISENSESDSDSEEDDEIEHQPVPKQRRATGPGRQQPSPGP EQASQHGGEIWMSKNSEIEWSSRPRKGPPHKAANVIRMQPGPDMAVTHTRDIKSFELFIPDSIQEIILDCTNLEGRRVFG ERWKELDQTQLHAYFGVLILAGVFRSKGESAESLWDAETGREIFRATMSLENFHIISRIIRFDNZDDRPARWQRDKLGVI RTVWDKWVRRLPLLYNPGPNVTIDEQLMPFRGRCPFLQYLPSKPAKNGIKIWAACDATSSYAWNLQVYTGKPDGGAPEKN PRNESCPRHVSGTQWTQHHMRHFFTSHKLGQELLKRKLTIVGTIRKNRSELPPQLLTSKNRPVKSSQFAYTADTSLVSYV PKKGKNVVLMSTLHRDGRMCDQEHHKPEIIMDYNATKGGVDNMDKLVTAYSCKRRTLRWPLVIFFDMLDISAYNAFVIWM ALNPEWKRVKLQKRRLFLEDLGKALVRPQIERRKHIPRTPASAAMVRRIQKENAGALSTQPTEPQSAEPEVNVZXVVNSS NKKKRCEVCGPKMDRKTQYTCIKCKKYICNTHTVKLWPSCVV >Pigibaku2 MSARYNAEEALELIFTHVQQDSSDSEEEVEDLSEEEDGEEYNPEHDESSSEEEENPEAERETFLSKNGKITWSSAEYDQH GRRAEQNVIKMTPGPTRYAVSHARDIVSSFYLFITPAIEKIILEMTNLQGFRKYGDSWKKMDETDLQAYLGLLILAGVYR SRGKAAASLWDAESGRPIFRATMPLKHFHTYSKLLRFDDRESRPARRVTDKLAAIRDVWDKWVEWLPYLYNTMVPFRGNL FTYFXCLLSKGRCPFRQYMPSKPAKYGIQSWVACDAKSSYAWKMQVYTGKPTSGCPEKNQGMRVVLDVTEGLRGYNVTCD NFFTSYELRQQLLKRKITMVGTVRKNKPELPPALLASKKRGLLIKVSLHAHHHSSFIPPKEKQECSSSEHTAQIRzHzRS WGQEAIILDYNRNKGGVNNLDKVIGTYSYRSMTAHWPLIIFHNIIDVSSYNAFVIWREINPSWMSRKQNKRRVFLEQLGK ALATPLIERRKHVPRTEASAAVVKAIQSAGAPDQPEVPATTATSPARASKRKRCQFCPQKKDCKPHTVCCKCKKYICKSC ALAYCPTCAN >Pigibaku3 MSGYGPEALKMWDTLCISQPLMELZKKPIMLEVNLTRFSFCVIQRTSYSFFFFMKFGDFFSSGVMNWRAESGHVGVSLNV CTEFRYVDLRTVISTLPHQSRSNVIKMTPGPKRFASAFQLFIFPIERIILEMTNMEXRPVFQEKGKPVNQTDLHGYIGMM LLAGGYMSKGEATTRLWKEENGRPIFHAKMXETFHMILRVIRFNNHDTRLGDVKKTNYKQRYVGZMGZNYLVVQACSPYC VPQYTPNKPAKYGMKIGAACDAESNYAWNMQVCTGKLPGFTSEKNQGRYMVLEMSESQQGHNITCDNFFTSYHLGDEHQK RKLTLLGTVSRKKPELPRESSXILKMQVRPLHSSIFAFTEKATVVSYFPKQNKNVXYIEYNPTDVSLSTREDKKPQTTLD PGQLDPQQHPSAIIGKVKLRSTSSGHRZKEGKRCQVCPSREDNKTSTSZLNFKNYICRPTVTFCPSCGEQZ >Pigibaku4 MVVCLYVLALRLTGVQSRVYPASAHCAGIGSSPPATLSGGTSGRKZVRESVEEGTEDRCDWTQYMYFKQFVTDEMLQETA EQTNLYSVQNECKSVNTTAKEIEQVLGMYMHMGLVQMPCVRAYWEMETKLPAVCDVMSQDQFLKLLTKIHFKDNLSVSDD AKKDKLWKLRPWLQKLRDQFLCIRPEECHAVDEIMVPFKGKSHLRVYMPAKPHKWSFKMWGRAGQSGFLYDFDVCQGAQN PESEKSEVGVTGEVVLKMTSTLPAGKNHKVFADNYFTSVPLVQHLKERGIHYIGTIQINRVKDCAMMDEKELKKNGRGSM DFRVNQDNNIIVRWYDNKAVNLISSFVGIEPVGNVKRWDRKSKTHIMVPRPAIVETYNKFMGGVDLLDMLSALYKFSFRS RRWYMYIWWHTVTVAVINAWKFYRRDQKKLEPQMKPMGLRRFQALVGTSLTSAGKTKIKCGRPPSSPEATATPPRKRPSC SVPLDMRRDGIDHFPTWETRQRCKHCTGNHFSHVYCEKCKVHLCLNKEINCFSAYHKVK >Pigibaku5 MRWRATLLIPNLAEFENEDETEHDRNGWTPLNYFEQFIDRDLMKTIADCTNAVSLSRSGDLLKTSVDEVYHFFGACILMS CVPYPKMRMYWSKSLRFTSITDRFTRDRFFKLRQSLKVLIDDDVPEDLRKSDKFWKVRPFLDRILQCCRSQTRPECVSID EQMMVPFTGACPCRQYLPMKLNPVGIKNFICATTDGIVLDFDLYQGSGALREQVEEPEGLSLGSLAMARLCQTLHRGTKV YCDRLFTSIQGAEZMMKKELYMTGTVMKNCSIAEVTYXDKSMQNAGRGTSTEVSTEDGKLCVVKWFDKKPVLMMSAVHGT QPEDTCQRWDKIQKKYVSRPSIVREYLKMGGVDLIDRMISYYCMSTRTKKWTMRMLMHFTDLALANSWLLYRKDLTTZDA PRKSIMQFLEFRVEVARTFLAQQYSQEDDADFPELSEGEDDSTQGKRRPVMAVPHVSVRRRANAHLPEMISLKNAARCRA AGCTGRTRVRCVTCKVFLCLQTELNCYAAFHTZ >TruPGBD1 MRATSVYATRVRGPRARNVPLDSDDSCLSDSGDSDEEYTPGPGDEPSGSSSDEDADVPPYAPPSAAGARREAATTQRNRQ KVAWETVKQENSAKEVPVWQDALPDAEAIRLPIQYFRDFFDGELLDKIVEQSNLYCTQQHPNRALNLDRPELEQFLGTVV YMSIFLLPWSRMYWSSTSRVQQVAEVMSRDRWEEIKHFIHFCDNSAPNNDDRLFKIRLVIDSLLPKFQALPQHQMLCVEK QMVPFKGRSALRQYSPQKPYKWGYKLFVLCDTTGLVHSFEIFTGEIGPAPGQPDIGASGNIVLKLAQVIPQNVNHLLYFD HWFSSLDLFVALANKGIPALGTIQQNRLRGCTFSADSEMKNKDRGAFEEQQAVVDDVGIRVVKWFDNRGVIVASTFAGAQ PVSIIERWERKLKRNVSVECPSIISLYNKFMGGVDALDALIAYHRIHIRSKKYYHRLFFHFVDMAIVNSWLLYRRDCESL GVPRRKRKDLLAFRASVAQALCMEGKDPMRQKRGRPSLDVDGQFEIKKRRGPAKAIPPQEVRSDAVGHWPVVENGRQRCK LPNCKGQTVYKCAKCNVHLCLNKVNNCFCEFHK >TruPGBD2 MQHVKSLIISFIYREDTSYEDSSEEEWNSSATKRGAVGKHRCSDSVSPLSMSLRSPSKRKEERCMCCPGPPRKRISNAST LPKVSSSLQAVGVFSSGEKQAEKELARNEPDADRWHDMDEEDFEPPQPRFRPERVPGPQLNRTANYTPLELFQLFFSTTV IDNLVKHTNANGKKKRQAQQKHWHTVTREDMYSFLSLVLYMGMVPLKAMTDFWKGSKLYRLPFPSSVMPSNRFLAISRSL HINDPAVETANDLKKGTPGYDKLCRIKPLYEQILAACYTFFHPYQHISVDERMVATKARIGLKRYVRNKPTKWGIKLFVL ADSSCGYTLNFFVDAGKDPEPTGKGRSYDIVMRILNVPFLGKGYKLYMDNFYTSPTLFRDLLSRKIWACGTLRPNMAGYP KKKGNDMTDKTPRGTIRWMRQGELLFVKWLDARQVNMCSTMHKAYSNDTAMRKVKNAKGEWTVKRVPIPGCIKDYNQHMG GVDLSDALISYYNVLHKTLKWYKTLFYHFVDIATVNAFILHKEMCKLQDRPELKQKAFREQLILSLAGIGSTPRRSAPQN HPGLAVAAPAAPSSSQVPDTTPPTAPASSHLPAYFVEHMNDVTPRFRATLGRRTCVLCKRKSPVYCSTCKKTLCFTSLRN CYRDWHRSNSICT >TruPGBD3 MATARKGRELVTILETSADAESSTACDGRESPLNLSADVKWFEIPYRKPDSDEEEEVREEEEEDDGGVGGGEGENGFAAA AAEPADAASFIAGGGCNIILVTGSNGITHDEEEYAEDCYYSTSTNCSDATSNDSDIDFSDLEEEERRSFFCFGDDLDDDC ASPDFWGEPDQVISIEPFSAVCGPQHSLGDDADTRDYFRILFPDSLFEHMVEQTNKYALYRQRRSGKSDPHWHPTDVREM KAYVGLNILMGINQLPDTGMYWASDIFIGNAGFKKTMTARRFEKLTQYLQLCDREFEPGRGERGYDGLFKVRPLLDVVEN TMWDAYVPNRCLTVDKCSIVTKGRFSPAQYMPAKPLRKGLTVWMLCDSRSGYCHRAKIYVGRPVDDEVAASVGYRAVTSL VRGLEGQFHHVFMDSFFTSVPLLQRLLRNGIYACGPTQPGRKGYPEVLRPRNIGKLSQGEFYQCQRGNLVATVTRDLKVV SCLSTNSAPGIVGISPDQREGEAHGDEERDSMESSGASYGHAATFAPAAVPGEHEGRRPLRPAEGVLPGGPGRARSGGAT SCGSTSTCASSTPTSSSGRAEGARRPPGFNGKQFTQRHFRVRLAQQLIGDYQGARGMERAARKRHADSPVEYGHRLERMS ERSRRCRNCTNKGLRHESVFGCKICNVHLCRGGCFSEFHK >TruPGBD4 CVEPDIPFCDAEVQSADQRDLLTQNSDLPSSTWKSANSWKHPGDANTKDHRIIPFVESCGPRHFLPKNSDAIDFFNLLFP ETLIELISKETNDHAKICQFLWSSFPDWVPVTNSEIRGFIGLIILMGIKNLPDLSQYWSWTHNDNSYTFYQTMSLIRFRQ IAANIRMGSVTTAECRGAQSSDALSIFRPMLEILGGAMWSTYQPNCSLAVDRALLPSLEEGRLKEDAKVQPEVWLLCDSK SGYCHRLSIQVGEKVQQGQGCTVVSELVKGLEGKHHHLYLANSLASVPLLQKLLDQGIYASSSFPQFSPILPRELWEEGS LDKPGDFHQKQFGPLLVTRWRDMKEMGCLSTNAAPGEHDTVWRRSQTKVGELDPVHRPLAFRLLQENMRGVDICKQLLAC NPLGGIPQDKHWRNLFWFLVNLSIVNAFIMLRESRKDSPPPWVQDGLFTQVIFRKRLGNQLAKCGQKYLDPGEMARSRTS IGPTEELVKERHRLAKISTFSKRCKNCNLKNLRHESVYGCSTCGVNLCKQPSCFWEFHGLPPLHKGCN >TruPGBD5 MPDTATALDFFQLFVPDNCIQNMVVQTNMYAKKFQERYGSDESWHPVTAEEMKAFLGFVTSTSIHRCESVLSIWSSGFFS NRSIALKMSQSRFEKILKYFHIVAFRPSQGSNQGLYKIQPFLDSLQQSFSHTFRPSQTQVLHEPLIDEDPVFITTCTERE LRKRKKRKFSLWVRQCTSTGFICQISVHLKEGQGSDGLAALKNKPQLHSLVAKQLCQNISGKNSIIFTGPSMTSLSLFSE FSEQDIFCCGLLSTRKSDCTGLPQSMLVCGSTPAQRGQSRIMMKGSLSLISWYNKGHFRFLTNSYSPTRQGMIIKRKSGE IPCPLAVEAFAAHLSYICKYDDKYSKYFIFHKPNKTWQQVFWLSISIAINNAYILYKMSDAYAVKRYSRAQFGERLVREL LELDDCSPTQ >HsaPGBD5 MPDYRTRALFVQSTLGDSAGPELQLLSIVPGRDLQPSDSFTASSSPPPSVWSELEHIRGKSEATTELKRPSLPGSIHSCL CGVWCGVGKRTPSSLVSSLQDLELLGQRQRQLWMESTPRPPYNPFLVPCTPVGKLSAEHGGPTRKMPPSASAVDFFQLFV PDNVLKNMVVQTNMYAKKFQERFGSDGAWVEVTLTEMKAFLGYMISTSISHCESVLSIWSGGFYSNRSLALVMSQARFEK ILKYFHVVAFRSSQTTHGLYKVQPFLDSLQNSFDSAFRPSQTQVLHEPLIDEDPVFIATCTERELRKRKKRKFSLWVRQC SSTGFIIQIYVHLKEGGGPDGLDALKNKPQLHSMVARSLCRNAAGKNYIIFTGPSITSLTLFEEFEKQGIYCCGLLRARK SDCTGLPLSMLTNPATPPARGQYQIKMKGNMSLICWYNKGHFRFLTNAYSPVQQGVIIKRKSGEIPCPLAVEAFAAHLSY ICRYDDKYSKYFISHKPNKTWQQVFWFAISIAINNAYILYKMSDAYHVKRYSRAQFGERLVRELLGLEDASPTH >Mmupgbd5 MPPSASAVDFFQLFVPDNVLKNMVVQTNMYARKFQERFGSDGAWVEVTLAEMKAFLGYVISTSVSHCESVLSIWSGGFYS NRSLALVMSQARFEKILKYFHVVAFRSSQTTHGLYKVQPFLDSLQSGFDAAFRPSQTQVLHEPLIDEDPVFIATCTEREL RKRKKRKFSLWVRQCSSTGFIIQIYVHLKEGGGPDGLDALKNKPQLHSMVARSLCRNAAGKNYIIFTGPSITSLNLFEEF EKQGIYCCGLLSSRKSDCTGLPPSMLTNPATPLARGQHQIRTKGNMSLICWYNKGHFRFLTNAYSPVQKGVIIKRRSGEI PCPLAVEAFAAHLSYICRYDDKYSKYFISHKPNKTWQQVFWFAISIAVNNAYILYKMSDAYHVKKYSRAQFGERLVRELL GLEDSSPAH >HsaPGBD1 ECAPQIPCSTPIATERTVAHLNTLKDRHPGDLWARMHISSLEYAAGDITRKGRKKDKARVSELLQGLSFSGDSDVEKDNE PEIQPAQKKLKVSCFPEKSWTKRDIKPNFPSWSALDSGLLNLKSEKLNPVELFELFFDDETFNLIVNETNNYASQKNVSL EVTVQEMRCVFGVLLLSGFMRHPRREMYWEVSDTDQNLVRDAIRRDRFELIFSNLHFADNGHLDQKDKFTKLRPLIKQMN KNFLLYAPLEEYYCFDKSMCECFDSDQFLNGKPIRIGYKIWCGTTTQGYLVWFEPYQEESTMKVDEDPDLGLGGNLVMNF ADVLLERGQYPYHLCFDSFFTSVKLLSALKKKGVRATGTIRENRTEKCPLMNVEHMKKMKRGYFDFRIEENNEIILCRWY GDGIISLCSNAVGIEPVNEVSCCDADNEEIPQISQPSIVKVYDECKEGVAKMDQIISKYRVRIRSKKWYSILVSYMIDVA MNNAWQLHRACNPGASLDPLDFRRFVAHFYLEHNAHLSD >Mmupgbd1p SPSPTEKAVSTLNTVGSCHPPHDSWAKMHIASLQYITQKGREKAKFRVIELLQGHAFSDESETEEDNEPEVQPERKKIKA SSIPEKSWTKRDSKPNFPSWSALDSGLLNLKSEKLNPVELFELFFDGETFNLIVNETNNYASQKNVSLEVTVQEMRCVFG VLLCSGFVRHPRMGMYWEISDSDQTLVRNEIRRDRFELIFSCLHFADNKHLDQKDKFSNLRPLIKQMKNFPLVCPPEEYY CFDKSMCECFDCDQFLNGKPLQIGYKIWCGTTXQGYLVWFEPYQEDSGVDKELDLGPGGNLIMSFADVLLEKGHHPYHLS FDSFFTPVKLMSALKKKGVKATGSLCENKTXKCPLMNVELMKKMNXGYFDFIVEEKEEIFLCRWHGDGFISLCSNAVXIE PVSKASCVADDKEXSFLQVTSIVKLCEECRKGVAKMDQXISKYRVGLRSKKRLWVLVSYMVDVAMSNAWQLHRICNPGSP LDLPGFQKCVACFRLGHDANLSDZ >HsaPGBD2 MASTSRDVIAGRGIHSKVKSAKLLEVLNAMEEEESNNNREEIFIAPPDNAAGEFTDEDSGDEDSQRGAHLPGSVLHASVL CEDSGTGEDNDDLELQPAKKRQKAVVKPQRIWTKRDIRPDFGSWTASDPHIEDLKSQELSPVGLFELFFDEGTINFIVNE TNRYAWQKNVNLSLTAQELKCVLGILILSGYISYPRRRMFWETSPDSHHHLVADAIRRDRFELIFSYLHFADNNELDASD RFAKVRPLIIRMNCNFQKHAPLEEFYSFGESMCEYFGHRGSKQLHRGKPVRLGYKIWCGTTSRGYLVWFEPSQGTLFTKP DRSLDLGGSMVIKFVDALQERGFLPYHIFFDKVFTSVKLMSILRKKGVKATGTVREYRTERCPLKDPKELKKMKRGSFDY KVDESEEIIVCRWHDSSVVNICSNAVGIEPVRLTSRHSGAAKTRTQVHQPSLVKLYQEKVGGVGRMDQNIAKYKVKIRGM KWYSSFIGYVIDAALNNAWQLHRICCQDAQVDLLAFRRYIACVYLESNADTTSQGRRSRRLETESRFDMIGHWIIHQDKR TRCALCHSQTNTRCEKCQKGVHAKCFREYHIR >Mmupgbd2P AVPARRGAHWTVRSPKLLQVLTALEEGEFGSNREEISLAPPDNASGDFADEGSGGEDSEQNGAZLPGWVLRALVVLCLGT QTXEEEEEDPELQPAKKKQQAAGKPQRLWTKRDTHPDFGXWEVSDPHIEDLKTKELSLVGLSELFFGDGTTSYIVHETNR YAXTLNLMTQELKCVLGILILSQYISYPRRLVFWETAPDSHHRLVADAIRRDRFELIFSYLCFMGNSGLYDESDRFAKFR PLIVRMNCHFQKHAPLEXFYSFGESICEYFEHWGGGWVGGVQASALREASRGYLVWFEPSXKPDRGLDXASMVVRFVDAL QEHSCLPNHIFFDKVXTSVKLMSILRGKGVKATGTVCEYRIERCPLKDPKELRKTRRYSFHYRVEESQEIIVCHVVNICS NVVGIEPVRVPSHHPGAAKAQAQVHQPSLVKLYQEKARGVDZMDQNIAKYKVKIXGKKWYLSFTSYVIDAALNNVWQLHR MCCQDRQGDLLAFRRHVASGASGEQXQTSSQGRRSWRVETESRLDMIGHWIVHQDKRIPCALCHSQTNTRCEKCQKGVHA KCFQEYHFP >HsaPGBD3 MPRTLSLHEITDLLETDDSIEASAIVIQPPENATAPVSDEESGDEEGGTINNLPGSLLHTAAYLIQDGSDAESDSDDPSY APKDDSPDEVPSTFTVQQPPPSRRRKMTKILCKWKKADLTVQPVAGRVTAPPNDFFTVMRTPTEILELFLDDEVIELIVK YSNLYACSKGVHLGLTSSEFKCFLGIIFLSGYVSVPRRRMFWEQRTDVHNVLVSAAMRRDRFETIFSNLHVADNANLDPV DKFSKLRPLISKLNERCMKFVPNETYFSFDEFMVPYFGRHGCKQFIRGKPIRFGYKFWCGATCLGYICWFQPYQGKNPNT KHEEYGVGASLVLQFSEALTEAHPGQYHFVFNNFFTSIALLDKLSSMGHQATGTVRKDHIDRVPLESDVALKKKERGTFD YRIDGKGNIVCRWNDNSVVTVASSGAGIHPLCLVSRYSQKLKKKIQVQQPNMIKVYNQFMGGVDRADENIDKYRASIRGK KWYSSPLLFCFELVLQNAWQLHKTYDEKPVDFLEFRRRVVCHYLETHGHPPEPGQKGRPQKRNIDSRYDGINHVIVKQGK QTRCAECHKNTTFRCEKCDVALHVKCSVEYHTE >HsaPGBD3P1 MPQTLSLHEITDLLETDDIIEASARVIQPPENATTPVSDEDSEDEEGVIINNLPGSLLFATAZLIQDGSDAESDSDDPSY AHNDDSPGEVPSTSTVQQPPPSRRRKVTKVVFKWQNADLTXHPLAGRVTEPPKGFFSKMRTPTELLELFLDEKFFEFIVK FSNLYAGSKGVHLGLTSSKFKCFLGIIFLSAYVSAPRRRMFCKQRTDAHNILVSAAMRCDRFETIFSNLDVADNANLDPM DKFSKLQPLISKLNERCMKFVPNETYFSFDESTFPYFGRHRCEQFIGGKPIQFGCKFWCGATCLGCICWFZPYQGKNXNT KHEEYGVGASFTLQFREALIEAHPGQYHFIFDNFFTSIALLDKVSSMGHQATGTVRNDSTDKAPLEZDIVLKKKERGTFD YLIDGKGNIACRWNDNSVVTFASSGAGIDHLCLVSYYSWKQKKKTQVLQPNMNKVYNWFMGGIDRADKNFDKYQAAIHGK NWYSSXLLFCFKLVLQNAWZLHKTXDEKPVDFLECRWRVVCHYLQTHGHPPEPGQKGRPSQKHNIDSHYDGINHMIVKQG KQTRCAECHKNTTFRCEKCNVALHLKCSVEYHTE >HsaPGBD3P2 MSQTLSLHEITXLNTDDSIEASTILIQPPENATAPVSDEDSGDEEGGTIKNLPGSLLRATANLIKXDSDAESNSDDPSYA LKFDSPDEDPSTSTAQQLPPSRRRKVTKIVCKWKXRDLTAQLVAGRITEPPNDLFTEMRTPTEILELFHDDEVVELIVKY SNLQARXKGVHLGLTSSEFKYFLGIIFLSGYISVPRSRMFWEQQXNKPDAHNVLVIAAMRRDRFETKFSNLHVADDANLD PMDKFSKLRLLISKRNERCMKFVPNETYFSFNESMVPYSGCHRCKQFIQGKPIMFGCKFCCGATCLCHICCFQPYQGKNP NTKYEEYGVGASLIHKFSEGLXTHPGQYHFVFDNFFTSIALLDKLSSMEHQATGTVRKDRINKAPLESDVALKKKEIIFN YGIDGKGNVVCR >HsaPGBD3P3 MPZTLSLHEITDLLETNDSIDSSAVVIQQPETAAAPVSVEDSGDEEGGIINNLPGSLLHTVAYLIQDGSDAESDSDDPSY APKDDSPDEVPPTSTVQQPPPSRRRKVTKIVCKWKXADLTAQLIAARVTEPPNDFFTEMXTPTEILERFLDDKVVELIVR YSNLHARSKGVQRGLTSSEFKCFLGIIXLNDYISVHRRHTFWEKRTDAHNILVCAAMRCDHFETIFSNLHVADNANLDPM DEFSKLQPLISKRNERCMXDESMVPYFGRHWCXFTQGKPVLFGYKFWCGAICLGYICWFQPYQGKNPNTKHZGYGVVESL VRQLSEALTEAHPGQYHFVFDNFFTSIVLLDKLSSMGNRATGTVRKDHIEKAPLKLDVALKKKEXGTFHYZIDGKGSLVC RWNDNSVVTVASSGAGIHPPCLVHRYSQNNEZLKKXTQVQQPNMIKVYNQCIGSIDSADENIDKYRASIHGKEWHSSPLL FCFELVLQNAWQLYKTYDEKPIDFLEFGZCHYLETHGHPPEPGRK >HsaPGBD3P4 MLQTLNLHETIDLLKTDNSSAIVTQSPENATAPVSDEDSGDKEGGTRNNPPGSLLPATAYLIQDGSDAGSDZDDPSYAPK DDSPDEFSSTSTAQQPPPSKRRKVTKIVCKGIKAGLTVQPIRGRVTESPNDFFTKMRTPIEILELFHDDEVVEFIVKGSN LCARSKDVHLGLTTSKFKSFLEIIFLSGYISVPRRHMFGEQXTDAHNVLAZCTAMRRDCFEXTFSNLHVADNANLDPMDQ FSEWZPLASKLNERCMKFAPNETYFSFDESRVPYFGCQGCKZFIWGKPIRFGCKIWCGTTCLGYIXGFQLYQGKNPDTKH EESGVGASLVLHFGEAITETHPGQYHFVFDNFFTSIALLDKLSLMGPQATGTVRKYCIDKAPLESAAALKKXDRGKFDYR IDGKGSTVCRWNDNSVVTIASSGAGIDPLCLVSSYSQKLKKKIQGQQPNMIKXYNQFMGVIHTADENINKYQASICGNKZ YXSPLLFCFKLVLQNAWQLHKAYDEKPVDFPEFHRRVVCHYLKTHGHRLKPGRKRPSQKHNTDSYYDGINHGIVKQGMQM WYAECHKNNTFQCEKCDVTLHVKHSVEYHTGQ >HsaPGBD4 MSNPRKRSIPMRDSNTGLEQLLAEDSFDESDFSEIDDSDNFSDSALEADKIRPLSHLESDGKSSTSSDSGRSMKWSARAM IPRQRYDFTGTPGRKVDVSDITDPLQYFELFFTEELVSKITRETNAQAALLASKPPGPKGFSRMDKWKDTDNDELKVFFA VMLLQGIVQKPELEMFWSTRPLLDTPYLRQIMTGERFLLLFRCLHFVNNSSISAGQSKAQISLQKIKPVFDFLVNKFSTV YTPNRNIAVDESLMLFKGPLAMKQYLPTKRVRFGLKLYVLCESQSGYVWNALVHTGPGMNLKDSADGLKSSRIVLTLVND LLGQGYCVFLDNFNISPMLFRELHQNRTDAVGTARLNRKQIPNDLKKRIAKGTTVARFCGELMALKWCDGKEVTMLSTFH NDTVIEVNNRNGKKTKRPRVIVDYNENMGAVDSADQMLTSYPSERKRHKVWYKKFFHHLLHITVLNSYILFKKDNPEHTM SHINFRLALIERMLEKHHKPGQQHLRGRPCSDDVTPLRLSGRHFPKSIPATSGKQNPTGRCKICCSQYDKDGKKIRKETR YFCAECDVPLCVVPCFEIYHTKKNY >DpuPokey5 MQKKADAKKVAQHKAANRNWKECKVWGDVGRQSRADDDSPRPQFQERAIQFAPLEEPGPVLSQFNRFSNPLGVFKSMLGG EDTLYLLREATNDYIAEFWSSRKTPPSRKVGGKPEGRLIGPRLPAGGFVTDHELVAFFGIQFLIGYHRLPELSMFWEQQP DAGLGLGIIQQAMTRERFKFISKHIACASPWDDVDPNSDDPDQEPERPDPIRKIRPLVKRLNERYHACRKPPRGQSIDES MVKFKGRSVLRQTMKNKPIKSGFKIWSRCCHRGYTYKFEIYQGARFGEKQGRSRNNEAVERVVVDLCQPLTDQGFVVAFD RFFTSIALLDKLRENGVNAVGTILPSRVNQPIMTKNESNLRPDEFAAKFGGEPGTCRKGIFVWRDTKAFRVASNYHGSNL VKVRRKQRDGSFKTKSCPKAIDDYVNNMGGVDTANQLRSYYERDRKAKKWWHRLLYSLLETCLVNSWICFNDMVRSQMAE IKTSNTQ >CinPBD1 MAVKGVSADETIWSFLEAESEKDKGDAAYACSSDESDILMDEFNATSSKNVDAPNHCCLSSDDETTVHTSSKLQKLLNDR SKSKRTVQQTHLEELSAEDSMEDWVRIVTDYYPEDHNLRETVMESGMDGVTPLDYLAMFLSAEFWDLLVTETNRHAAQTL RKKKLKKGSNLRTWKDTTVAEMKAYFAILLSMGLCNTVDMQDYWSASWITVTSSISKIMSRVRFTLIRAMLHFCNDEESS SKNSQKHNRLFKVRQLIDVLVPKFSALYKPDKELAIHEMTVACNYKSEQRVRKKPIQWTDKVYALTEARTGYLLEWAIHA GSSRETEKGASIVRKLCTRYIGKHDIYINTANSYTNRNLAKEFVSQTNGSGGIPGELKTINEKNNPVCAKSAVRSSEIKA KSATQKGNKRSYNDMKKANSKKRYNYLSGVIPIFRQLNLFRHKTVKWSLRIFENLAQICVVNSYILYTSKTSDSSDKMDL KKYIEACVSGLLVDYNPHITEKWRPPQPGTVLSRILPPQYVHKIIKIDKKPQCVVCSDSRRKLGRRQTSFMCEKCNVALC VVPCFHRYHTLKNYRVCHLDM >CinPB1 MFTVRTFSVEEAAAICCDVDSCDENMSLSESTYDSCESDDFIEPILTASPSTSANIQPVSVQDQEVSSTDSDVSSACAQP VHPKRAKMTKVKTNRKRPKVTNTSNIPHDLQDFNWEPVNNSFETSFIPQSSSFSETSGYGGDLVLADSTPLDLLGLFLTN EFWQLLVDIFKSKLTSYLQKQTDELPKFSKFRKWSPVTHADIKAYFAMNLLMGLCSKHSIKDYWSMYSYTNTAGISSLMP RDRFQSIRAFLHFNNNENYIPRGQPGHDRIFKIRNIVELVTKNFSKHYTPHKELSLDEMTIAYKERSSIKQYNPIKPKVF VLSEARTGYALQWDLYTGKSEDVDSSVSKTHAIVRKLSQEYLHKGHDIYMNSYYTNPYLANELSKLKTGVCGTISATRKG MPESLKKKNLKTKKGDDPIFLRSGDLLACAWHDVRRLTMLSTIHNASSTETTIRSKKVDTGTRTILKPICVAEYNRHMGG VDRMDQRMKTYIFPHRSHKWYMRIYDGIISIAMVNAHIISFSCPSSSNKKPKSLKQFIEEIASELLNGYTSARKRAGKQQ SPLHFKRLIPFQHQHFLGKTTRKSCQCCNKQTMTLCKKCNVSLCALDCFERYHSLQEYRMK >CinPB2 MMQLQLILSGDVSDVEDIGSSSEDETDNTVQESFQDTVMNISVPDKVESEHKKKHVYRWRKRNIPVTDSNFQLQKDNIDS IHSPITYFMQFFPESLIRTIVEQTNLYSTQKIGVSINTNYSEICMFIAIQIKMSILHLPSYLMYWSKEMRFPPIADSISL KRYQKLRRFLHFVDNSTFNSDNPNKLFKIQPVLDAVRNECIKIQPEQSHSVDEQIIPAKTKYSKFRQYNPKKPVKWGFKN MVRADSSGFMYDFYIYGGKDSKQLALSDDATHLQKSAQTVVKLCQHLPVKQNHQLFFDNWFTTLDLLIYLKEIGINACGT IRGNEDLKKNGRGAVDFRSDFNSGILVTKWYDNNAVHIGSNFVGIEPMSTIDRWSSEIKEKVPIQCPQIITMYNKGMGGV DLADMLISLYRTEVKTRRWYIKIFWHCIDIAKVNAWLLYRRHCNEMSISKKSQRTLLNFVVDISDNLLYRNSCSTPTRGR PSNKRKLENDTLPGKKPFTPTPNEILRFDQISHWPEPRSQRGRCRLCKSGYSQIYCSKCHVCLCLKSSNNCFKEFHCKN >CinPB3 MFSATAAAEILMDAGSDLSDLESDHDEDDDVGSFIVPNVADISDSDSESSDDSLPPPPPPANVWKSSITQQSLNSFLGQH GPSSHACVSNDDSPLEYFRLIFTDELLTLVVEETNRYAAQYLQKTSLSSKSRAHKWKPVDAEELSLFLGLTLLTGVVHKR GKLESYWIKNSMIETPYFGKCMSRNRYQAITGFLHFNDNEKLAENIDNDKLYKVRPVYDLIVARWKALYNLGEHISIDEG MMKWRGRLGFRVYNKDKPIKYGIKSYILADSHSHYCWNLDMYHRVQKTLKETVSQILTSKCHFLWHSLYMDNFYNSVSMS QMLLAFQIHSVGTLRSNRGEPREIRTPPNQMKKGDIIARQNQSVTVLAWKDKRVVKAISTKHDASVTTITRRQRRGGEXE SVEKPVCIADYNLHMSGVDQVDQMISYYPCHRKSLKWTKKVFFYFMTISVHNAYILYKSKSSAKSCKTLYSFILTLVSQL CQQDRLQPQIDDENLAGPPPKSPRIDSTKRLKGGFKKHVIALYPPTKKKAAAQRPCRACMKNGCRKDTILL >CinPB4 LFFATAATEILLDAGSDLRDZESDHDEDDDVASFIALNVAYSSNSDDDSSDNSLPPQPANVWKSTITQQSLNSFLGQQGP SSHACVSNKDSSYECFRLIFTDELLTLVVEVIIRYASQFIZKTSLTPKFRANKWKPVDAKGMCLFLRLTLVTSIKRRNLG SKWSKDSMIEXYFGKSISXIZYQVITGFLHFNDNKKLPENIDNDKLYKILSVYYLIVARWKSLYNFGDHISIDEGMIKZR GKLGFRVYNKNKPIKYRIKSYFLADSHYCWNLGMYHRVQNXLKETVSQLLTZLYMDNFYNSVSMSQIXLAIZIHSVVTLR SNREEPCEFZTPPIQMKKGDIIARQNKSITVLAWKNIRVVKAISTKPDASLTTITRZQRRGXEKESIKKPVCITNYNLHM SGVDQVDQMKIVYYLCHHKSLKWTKKVFFFYFIKISLYNAYILYKSKSMAKLYKILYSFILKLVSQLCQQDRLQAEVDDD TVAGPPPKSPRINSSNRLKGGFKKHVIVLYLPTKKKTAAQRRCRVCMKNSCRKDARYYCAYY >CinPB5 ELLETETNRYAAHTLDNKTPTPSSRLQRWKDTNIPEMKAYFVLLLTMGLCHKPDINDYWSAFSVTLTSGYGKIMSRNRFL LIRSMLHFCNNEDFIPRHEENYDRLFKIRRLVDIIVPKFDQVYKPQKQLSLDEMTIAFKGRSTIKQYNPHKPSKWGYKVF ALTEATTGYLLQWEMYAGSSMETDEDVSKTHSIVRKLCSGYMGKQHEVYMNSYYSNPYLAKEFKEKKTGICGTINCNRKG MPDELKKKNLKTKKGDDPVYMLSGDILCCAWHDTKRLTMLSTIHDAGVSEKSIRSKTSETGTRMVMKPNCVTEYNKYMGG VDRIDQRIRTYLFPHRSRKWYMRIFDNLIQICLVNSHVIYNTLPSGSNEKKLTLKFYIQECITGLLQEYTPGVLSPRRKS KDTISRIVPDQYYHKLIKEESSKPNCAVFFLSVZANTRDYPNDLKCKQAIRGKSREKDFWYICLEITIZ >DmeCG9839 MSSSGRKRKQQLKPRQDDHRSPVKRRSVDIKSEPLDGYPALADYDLSTADIKPDLTELQLQLVAEQQAASNTIRLELEQQ ESDSDEDGYSELDYQAEDVFCQDDMDDYDPDWSSQQTGSRLLFKFPIQQSGLKFGQRFQGPQHYFNQVLGNRSKFFSSLA QSCNLKGGELKSNPTTAEEMEIFMALSLLMCDLKLEHLSDYWSTNMFYGLVGFSGKIPLERYQQLLHCLNFDAPQLQAGR AKVKNSLLLDFINERMEEIYICGQQLVLNEPITLWKGALRYQDELPNKFRTNALLLHMLTEQSGLVVKILPEIVRKEDAP AWVRNSRQLVEHRNKIVLKLMEGYHGGRTVYTSKFYGSYGLAQELAKKSTYCTGLLDRNRYGNSKALVHQRLDSNSISTS YATSLMMAKWRRRAKSLYCFSSDCLAIYSKEMAMQKTNAKPKLIQELEFQLRPGNDGRHHLIHYQAACKELKANIKLTIF LLNILVYNAYLLYFANGQNARVGHLKSYSEFRVIIIKSLLREEVTNEPVTSIQKPETYERSKNKPVPEPRLKTILHEPML IQQNGKPAKKNCRYCHKGGMLQFSRYMCNTCPDKPGLCQEPCFLLWHEQLKKVIRQTIGRSE >DmeCG13151 MECVLDEELLANIKCSDQEEEDEDGEKMEVEERLPPVDSTVQSASFNGDDSDPLQEAVCNFPWIFEDSDMLMNEDQLADV VLKKEDSARPAAPKRGRGRPPNNNGNYTSPCGQLWSVTRSPDISAEDLPLLGQQACGKGPARTVSNAVEAWMLLFDDEML RSLLRHINEQMRKRRTATSVQRPLDVVELRAFLGLSYLCGVFRNARHNGPLDELWTLELGNAIFRASMSLARFESISECL AGNCGWSEGQKLWQRLIINCRSYYGCSSWLTVDETFCAVAKSRMTLCCDARTLYMANAVVSRNQRCPDKDVEQLICDFKT TGRNVTLGSRYLNLTQCEQLAQRQISSLGKLEANSPHWPRQWPTESPLFGGSSKLIPLDGDAVFCCGLSSQVDAVQAYEQ TSEACQQFYEHSQRFSTAHATPAPLKKQINPFLQLLHFVLNAAAVNAWILLRLSPKGDAAMDQRDFQRQLGLFLTQQRLQ RRLQRRSTSTSLVMRLQICEILGQSSQRLLSEATGEAKLTHSVGVLTPDKMSLPLGINLASRYGEKHRRCKPCARNKRGT KSRTRCQQCLQHRCGNHLISRCYECVGILPGQLPEGNMVDEGAT >DmLOOPER1m MEDISTVLEKNLEGILERGESIEIDLLENTVIEGCEPDSCVVVDSCLEKIDPKTLKWRTRPFVAPESIWEDDKTFDVGDI KTTVEFFYTLFDTQLIHLMARQTDIYSLQEHGIELKCTDEEIKRYIGILLYFGVLKLPQFRMAWSKDLKITAITDSMPRG RFKKIKQCLHFNDNAKQLKKGDCNYDKLYKIRPLLRILKXILEKLTQEEHQSVDEQIIAFKGTFLIFFXSKPHKWGLKMF TRAGISGLVYDFTLYVGEGTSPSYGLGISSYVVLYLAESLPKDKNFKLYFDNWFTSVILLISLKEIGIFATGTVRMIKXQ PVVICKRWSPKAKAYIDISGPAIVALYNKGMCGVDLADMMMELYKINNRSTFFIVAWEYSLQKLRYRIGNNSSZZPQNKN IFSLSNFNRKLPMNFYIPLALLHLKKETSKNKZRTRKLSSIIGIPKQCLFASIKEVQIFDKSYXEHWVVFGERGRCRLCK TATPMTKCLTCKVHLCCNNNKNCFFVIPHLNCHYKEKYFIFCDL >NhaPB MRGTKSLIPEGIPANSPPKHHQFILIPSMTSPPILEEIQVINPYDDNSFIKEEHSHCLWQDDPTQAVNLPAENDRGTNFK PFHVEIRKFRISPLPPTPLQLFQLFLPISLVEKWVSYTNSWITCLKENGVVDSWNNPMGKTSYLHKWEGTTVSEVLTMIG VLIYMDVHKEKTIRSYWNPPKPGVQRPAHSFIKFISYNKFQLIHRRLRPFDHTKYDETAPIPKVFQCVEEWSDHIQAVSM QIFLPGSHLAVDECMIRYTDRSDDITVIKSKPDPVGFKIWVIAQYGFFIRWIWHVKEKPHGAVGVEFQLRSHHHKVGQAS EEKSQSKPLI >OsaPB MQEPPDLFVHSDGSTETKLIKEKRKHFDSASSSFFAYLPLSFWKAVLGETNKYAAASPAKGKTVTLEELMRFFGIMFYMT IVDKGEYSNYWGEQVEDEIFGVTSTLGLEKLMTLKRFYIRKNLCFRYDISKADLKKDPAARIRPLINMIKHTSLKYVVLG RNVAVDESSIACRSKFGRHMIVYNAKKPTGKFHFKIYACCCATTWLMVGFRLHCDSDMEDRLRDVIPAVDAQNLDNRLQF SSSVRQIVLEVTRPIHNTQRVVNTDNWYTSVTLMLSLRDVGLYGRGTIRENSAHFPKAHMFAKKANEPRGSSLQGVSNTG QMIAASWMDGSAVNILSNADSSGMGEVTRMIGKERVVFPAPKCVAEYNKYMQGVDRLDQLRAKYSLADGHSMQKWHKKLA LAFIDIARVNAYVTKCLRDDKPLRNQHRQFMIELASELITGKWNDTVENEGMVFADDQLSTTSRSTTGYPKAPSTVASPT PPCDVVLSLTRFPEATRGKRGCKVCMFEGRTWTMKTLYCIRHNVCLCTKSYSLNQSLADVVCPHTDWTSWQKYNDYYLPN GIFDEHGR biococoa-2.2.2/Tests/Test-BCFoundation/DataFiles/UBBYB000644 000765 000024 00000005615 10674547336 022737 0ustar00scottcstaff000000 000000 A `                                                                                   >protein R002; protein YFL037w; product=tubulin beta chainNtubulin/FtsZ GTP/GDP-binding (G-G-G-T-G-[ST]-G) motif; region_name=region;tubulin beta chain - yeast (Saccharomyces cerevisiae). 2144824microtubule.baker's yeast.Saccharomyces cerevisiae Eukaryotae; mitochondrial eukaryotes; Fungi; Ascomycota; Hemiascomycetes; Saccharomycetales; Saccharomycetaceae; Saccharomyces.  /1 (residues 1 to 457) 7Neff,N.F., Thomas,J.H., Grisafi,P. and Botstein,D. fIsolation of the beta-tubulin gene from yeast and demonstration of its essential function in vivo Cell 33 (1), 211-219 (1983) <2 (residues 1 to 457) Naitou, M., Ozawa, M., Sasanuma, S.I., Kobayashi, M., Hagiwara, H., Shibata, T., Hanaoka, F., Watanabe, K., Ono, A., Yamazaki, M., Tashiro, H., Eki, T. and Murakami, Y. RSequencing of an 18.8 kb fragment from Saccharomyces cerevisiae chromosome VI $Yeast 11 (15), 1525-1532 (1995) 3 (residues 1 to 457) Murakami, Y., Naitou, M., Hagiwara, H., Shibata, T., Ozawa, M., Sasanuma, S.I., Sasanuma, M., Tsuchiya, Y., Soeda, E., Yokoyama, K., Yamazaki, M., Tashiro, H. and Eki, T. Direct Submission 5Submitted (??-MAY-1995) to the EMBL Data Library=On May 31, 1997 this sequence version replaced gi:71592.<ffff= geneva <ffff9  OE qgd, ]S Hbiococoa-2.2.2/Resources/BC.icns000755 000765 000024 00000171114 10404057133 017056 0ustar00scottcstaff000000 000000 icnsLICN# R*If l`LЀ0X 0p@` @\ H |(@p`~_@???????icl4 || |ww|||mw ||wp|w||    ,    ݻicl8$**$NNrxry++++++++*$NNrxrxrTrNr++++ЫxrxxrxrxrNxrVणxrrTNxxxrxNrxNN*$r*r*NN$xrxrxNr*Μr*rNxxrrN**$VNxNHVNN$+V+X,VV ,+++++++ +++- %++V ++V*+W,+ +^+,+++++++++V++++++++++V+*+$$U$VV*+V3W^ ^1il32 ؼ֫twxkЅйxgjmqswx|n@#.@NSW[^cejlprvwzLe@)2:Acz{SVZ^beilor5:Ws@(iWUY\`dm6+H*f@GzpeT^r`"}@<|DCTW5@@ _@ ez6@)'lxfiN@âC@ӧ|@u@_Q*@(hkYg@܉RCѮ@(Z@t€@aI+@;3{@tUP@N)}@[@Hס3@nE2e@EwSu_B @Ӗz@ Ф}-+c/@ +fz5@ (2YS֕ùυƼw=2Vkc=UsĽ9Vq=h櫪4(H(d=Rϸβ_}=6U2==`^= dz4=%jndbL=qâ@=ӧ{=f=_Q)=#hkXg=s݉RCѮ=#[As€=^I+=;3{=tTO=N)}=[@Gס3=lE2e=BwSu_B =ΐz = Ρg%)b,= $SW0= ")WQԪЅ?F e?:Wr? 5*H)e?_!}?V V4??p^? ez6?JlSnueNjskM?>omâB?\mӧ}?8k?O_U+?ohklh?;݊RNҮ?\@À?`I6? ;6?vT^?O*~?^@[ۣ4?pE;g?Fwa}aD! ?Čz? ҥ|eM.*c.? 1#70? XRl8mk!Q}DpT>m 0`jU52BqYeR+CrHk8! "*nJG}E)SB0v[̭b/.ַkJ- e5 ;VYj\ tC F"B? ich#H@ TUTQ"U@I/z$*bR rq@hV|" Xx 8`p`  p@DAr$@ @X`]$p (@ B @ E _{AV o"T}<@8X n 2_[w} ? ?????????>ich4 ||\ |||| |w|}||||||uwp||w||ߕwpp||||||||pw||||||}| |||w W     ߮  ,  \    ߮ ܺ껲ich8 $*NrNU$NNrxrNxrz$*NNrxrxrxrNxrNxVONrxxxxrxrrTrrxNrxNxxxxrxrxrxxrrxNrTrNVVrr*rxxrxrxrxrNxrTrxrNrUࣜ$Nx*HxxrxxrxrrxrTrxH*Мx$NN**Nr*$xrxrxrxrxxNN$VxNNNNrxrxxrNN*VNNNNxxxrN*VNrxNN*$VVϜxNN*$++++V+V+V+++++V ,++++VV^,+++++VVOW  -++++++V  ++++++++ ++++++V- ,+++V+ ,+++++- 3++++++*V +++++V^-,+++ -*+++++3+++*4++++V+,++++++++++++V*++++$++++++++++++++++\U+++++++*++++U+++*++UV%$+]++%*%1z+,VX^V^54.^+OVV1+ih32zz ˫utvwxz\ӻhikmprsvwxy~rZ]_adfikmorsuwxz{Yf'.:ENRTWY\^adehkloqruwwy{L*3f &.6?DFTQXRTVY[^`cegjlnprtvwy*4p.f+<=?ABJdQTVY[]`cegjknprz# H8ff`f٤6[vYf7π^V@:fy܀ AYxfHaY07񡀁fſٴ;P{Ufހ@X$V[fLJ:Q'ׁf߽9b)c}fNLA*ff 24Yeƀm9fhE8+㶌e4f _w ԧP*Aff}waI$ ff!ɖz2 ff߀ Ŵf$omDffۦg&^_d٤6[vYd0ƀ_WA:d#vAYxdFbX07񡀁d ٴ;P{Udހ@W$V[d$Ƈ:Q'd߽9b)b}dLLA*߀fd04Ydn9dhE8+㶌e4d _w ԧP*@d_}waI$ dd ߁~z1 dd߀ ѻSnlBddբb"nL:aLddB{+WJdd  .<dddˑ˂ِ|e1[2e Ck 3p-e H7eeTR *H:ee# }ee mpm ñle*e^nm䛺mee7lm߶ݸ~-eeVklǍee`_Uo ee%=aOL:Kee\hJlhee 4W߀uH:L`eI٧7["̀YeaW@Le#sAY#zeLcY0I񡀁e ٵ;PUeAW&p^enj:Q6𥪀e߽;b*x~e Qڀ LA9he 45Y|p=eoE8=湑g9e _w)کS.Aei}wpP' ee !ױz1 ee ̧]=nmCeeܨh!#)-;aMee1)7Gee  %eeȇ̂h8mk 4xU,Kk 0r-DX8Xx @ 1.]K8d B = P = @ x,; U.s*3 *]o)c )QD21W"ZjB 3aw+HRr) "t`>ɤQݾwaF4£{aK<,٥}jU@,NvG/ )ɜVҷz1^W dwZDCߎ: f$ -}O ]W)  ics#H 3#aC???ics4ww|wwwww|| ݾics8xrrrNNNNxrrrNNNyxrxxrNN*$$rNN*$V$+V-4+++++++VW^is322IS`kxY 3GN_kum )/,UsZ\n4mCjtEGĐKpziخHⲮ.DZrc& /ڳ>a eo Iǝ^ z؊HO"7>I} â &,x5 lBUsCSĐJby\خF Ⲯ.9Zrb&.ڳ>a en Hǝ^ qԊGO"2s5Fӆ ֆ (.Ć5mCwsDcĐK5}z3xۮHM累\uuk( 1Cgiz PԤf }܏MU%7iB+Gs8mk5dy ,\!-~cP&fہEftC":a xJ% EϿ it32i~}{z{zvwxyz ʀyttuuvvwxyyz{~wqpprrssuuvvwwxyz ήtmlmmnopqqrssutvwxxyzбojhhijklmmnppqqrrttuuvwwxyz{Ҳjecdefghhijkkmnopqrsstuvwwxyz{մa^_`abccefghhiikklmnnoqqrrtv wwxxyyzz{&ٵ\ZZ[\]^__`accdefghiijklmmoopqqrsttuvwxyyz($0LKMNNOQQRSTTVVXXZZ[\]^_`abcdeefghiikklnnoppqrrstuuvvwwxyzyz{{'0:H+IJKLLNNOPQQSTTUVWXYZ[\]]_`abcceefggijkklmnooqsstuuvwvwxxyzy{{ixM%-6DCEFEFGHHJKKLMNOPQRSSUUWWXYYZ[]^^_`accdefghiijklmnnopprrsttuvvwwxxyyzz{~ĝbr:D#+3<@ABBCCDEFFGHIJJVMOPPRRSTUVWXYYZ[\^__`accdeffghijkllnooppqrrstuv wxxyyzz{{yuŋVe")07=>@:ABBCDDFFjIJJxOOQQRSTUVWXYYZ\]]^_`abcddegghijkkmmnnopqrrtuvvwx{ P@ߥmPH:;<<==>>??@AABBr[EGIIJdOPQRSTUUWWYZZ[\]^__`abdeefghijjklmmnppqrrstuw  1[}Pt8;>??AABCRFukIIbOPQRSTTUWWXYZ[\]^_``bccdefggiikklmnnopqrrs| 5Q=Fǁ;??LB}[II!ӲPQRSTUUWXXYZ\\]^_``accdefix dO&7+;<=<>??@qN~EI`LLMqQRRTUVVWYZZ[\]^__aacm҃q j~rЙac4;<<=zb>?@XqBDQvwbKLMY|QRSTTUVWXYZ[\]]e{ˀ e|P,:;<=U??@XqBDERKKLMNOPPQSSTUVWXY]p vʐ\j+6;;<=>?@MBDEEi_IJJKLMNNPPRRSTWe dsSƄ.;< V|AAfDDFFGGHIJKKLMNOQ[rǃ mŋVt !;<<=cABCDDEFFGIJLRf޻ޤ emU:<<=Un>?@@AABCCDEEFHJZځ仩ƀ kR~p7<;=<=>>?@@AABCCEOi͂Ƶu i٢gY3;<<=>>@@AF\Łѯ dRK*;<<=>Vx֯˺﯁ d~rәaa ::Ji۴ׯ b|S5'v|͓\jϴʹ紩Ѐ avSƄ ɳ߀ţ oōVt(ξιմ۴epUhӮó﹂ mR~o"ͭ宣 ȿi٢gY܄ͳȮγɮѻ ӦgRKЀҷ֣݀  ܯ ~rәaa‚ ۲ܳ訳Ŵ˯ ؝b|S5ۼ ﲷﲀͣ v~͓\jܳʹҘavSƄ׀ۼѲ˷̳܀ԮִrōVqзƣî ڴ崀͑bpUֿ "޳մ ܮmRyooݻ訲س޹ɩ Ɋf٢gYŅҸԀ ξڮ ۦgR~K:­׽݀ﳳ €rәaaɀ&彷ݳ踾 ٟ_|Q/݃„"ƽמ糳y~͖\jH}ߺƲ׳ěavPɣ˃ۀ˂᭲ԾɴsǐYq9΀ŭ伀 ۣbpRǢCŀ༨ԾnUyײڻϻ "ӳӍfܢjYţ |ὁ ͳdU~ȢՁۂ ݃&콳øȸƀrӜaaЀTαĬ+ȳΠ`QʟځƒӂѽǽأƼ͖\jрܺ3­ͨĘvPɡmȅ`ǐYqӃ֭֭Ѩn:jpRĠSϣ۷*LsW56y ͻ j8fdE&{šȃ9޸ ֿͬ Ķ jIbrR3d߂Ȭң ޷tK 1s΁麿DZ0>mTȳiÀܢ܀Ƿ˷FBpaEOaUzҁھс ɬ۷‚#0\lK- tȃ9ༀիں߭ڀӨ@"Go[:dѽ ¬ ŲƵe(6bhI)$gDž߁'Ŷɶ80MqW5 Fp+걣߭ޢO/@ccD%(iɺҀ&ζƭp27VpP3MBõͬӁ ԬٲԬB.FkaC .m ڬֵҶλ챁 s,7XoM/Qʆ %իߺ׶ħʂ֭>*Fn_>8yр֭zڀȧìۿħo*6[jK- Y˷$ 年ǀǀ 俵2*Iq[9>ըƭ ϰ„޺㱱k#5cfK)#^ۼ" ذݫТ)(MpW5 Cqòہ尽幹ݫ T!9ffG&(bZưζą#+PqR5Kź伀ۂ ʴɶH8w˻)Ы駧'[lL- XNԴ%Eq[:>́ ܰn /ahK)#_Àք ƫذԀߧȸKqW6 Cͼ״˽«T 3ffG&(hŀ|ͯů΀'䧸ԧPqR5K΀i/ ڳ΃ ثṰA 8lbC .oƀׯҸ݌"VpP1PDŽŀ ͧ߼ 2 >pa>8vȁ ޳ɼ'YlL- X \ټن +Cq[:%NqR5Hʝ_lŕcC .mʩq5е^jP̴KހŝfWT:u~R߁Թ`cW%߂ϥlwoNL0߁ÈZa{Rqk ߄ոZlwmYa ߇ p3 beR ߀߇ɳM -cqP~߂һv kflRm,ײp3/6z]^\?‰P tn ?o]PJl  /0a`Ny_  Jh^6q ᾽㿼忺 ֹ طصʰʮ3Sp /Lk,He &D`iw#@\y ĝbr9 8x֭t!ȧìۿħ݁p*6]kL- Y˷ $湴俵ɂ4)IqZ9>ըƭօ τϰ ޺㰱m%6afK(#^ۼցذݫТ()KqW4 Cpòۂ湹ޫU9ffG&(bˀYưՀζą#+PqR5Ký  ˴ ȵI8vʻ!Ы駧'[lL- XLԀ յ簁%Eq[:>~ ܰـn /ahK)#_τūذާǷKqW6 Cͅ2ͼ״ʽ«T 3ffG&(hŀxͯů䧸ԧلPqR5Ki- ڳ́ ثḰ݂A 8lbC .o݂ ׯ Ҹ݋"VpP1PŀΧ׀2 >pa>8u޳ɼ'YlL- X\zټ +Cq[:%NqR5Ĥʝ_eŕcC .mʩq5ϵ^jP̴KÝfWT:t~Rи`cW$߃ʥlwoNL,߉׷~Wa{Rqj ߆ɩqJlwmYa ߁Ȱxilm\+ beR ߆иikmpruu? ,cqP~x߀qjlnqtx}`  kflRm)ހŤh/&kmosw{, y]^\=ϱ}I^~Y=o]PHa ')a`Ny]  ~ƣ<sah]-ʾ\os塯FwAoε ;jɺ3dÿix._ĝbr9(YyuŋVe#Q P@ߥmP  1[}Pt 5Q=Fǁ  hb0 iٟBp dO&´ q i~rЙacy e|P vʐ\j dsSƄӠǁ mŋVt߻ߤ emUU㻩ƀ kR~oƵu i٢gYѯ dRJLJ$֯˺ c~rәaa۴܀ ׯ b|S4ˀv|͓\j ϴʹ紩Ѐ  avSƄрɳţ oōVtξϹմ۴ epUnӮó  mR~oͭ宣 ȿi٢gY?Vӂͳɮϳɮ Ѻ ԦgRJ spcҸף؂ﳮ&ݯ~rәaapvxsf ۲ܳ訳Ŵ˯ ؝b|S4eruvxtilͣ v~͓\j ^mrtuvwtk[ݳʺӘavSƄ ioprstuvum_ǂڼѲ˷ͳծִrōVqjmnoqrstuupbзǣî ڴ洀ΑbpUgmnopqrtuvpe~"޳մۄ ޮmRyo7lmnoprstuqga騲 س߹ɩ Ɋf٢gYVlmnoqrstriZҸԀ ξڮ ܦgR~J $hmnopqrtsk] ­׽À  €rәaa Glmnopqrsm`潷ݳ 鹾ڟ_|Q. _lmnoqqrod}$ƽמ賳 y~͖\jI l!yȳ3d_Tܢ܃Ǹ͹FApaEOalӀR_Vjс ɬ۷ł$0]lL- vȁ#^XJլ ۺ߭լ?"Fp\: wڽȃEYLπ ì&Ų˸g'7bgH)7QN  Ŷ̻:0MqW6iۃ2Q} 뱣߭O0@fbE&<ҀE[ɺҁ+ζƭt19UpQ2r!DĶͬԀԭڲٴD/HkaB!E4ֶ۬Ӷλـw,7XoL/!v҂ "լߺضŧװ=)Go]= Tۃ׭eǀ ۀȧĬݿħu,5[lK, (˷܀&湴忶3*Gq[: ]ߨǭց ހϰ ߺ䱱o$7bgJ)4۽ׄ ذޫѢ+(KqV5dͲ氽繹ޫW 9ffG&<сˀ̃a ǰՀζĆ#*PqR5pف ۂ˴"ɶJ T׻ބ#Ѭꧫ'[lL- (SՀ!յ麧%Eq[: ]ف )ݰs /ahK)4Ё,ƫذ৺KqW6dۃμش˽ëX 3ffG&<Ӄίů΁姸էڄPqR5pq1 ڳ ثṰ݃ B 8lbC EԀ װӸ¸π"VpP1!x 临Χ؁3 >pa>T ߴɼ'YlL- &Đc ڼۃ,Cq[: [؁Ъgցq+ahK)0ڪzIqW6bڷQDžZ 3fhG&9ěg>%NqR5lڪg oʕcC Eڷz9ീ^jxÛQϝfWTSZ㿈`cW*ݦlwoNL1w\a{Rqj ǐg/ lwmYa ہǝt< !"  beR իW !"#$$ ,cqP~!ฎV,!!"#%&(  kflRm+߀ڵs3 !#%&(*,)z]^\>ċQ #$&(*,.0/!>o]PJl )+.0133)a`Ny^  &12450@;h]253$9.L&+dDt8mk@@@p!0`t P@0pa ` @@p40`P @0`S P @ *@p3 1 `s C P GLA B,  DIy2  N3 #wJ/ ($ 'pY@(  %nr dL4C 9V>( ; `G02DXS:%*  aG.  #`gT:#A# `G/ 8c~S:$0  *^F. (| rQ8" "HC9\C+ ? gN5 5IY@) -dK3 &om\V=&  EaI0:~S;%^F. UrQ8"&\C+ gN5 fY@) dK3V=& VaI0E~S;%;o`F.  'O}S8"7`G,  "G> /X6 @r?)Q~8b #J2[EC~ +S;d$ %Lc4] D-VC=p  &N6_ !Gc/X ?q )P48c #J 1aFS/c I 1g3Ns7q $YBS0 #TD%5r,  $bBD9 1)}$ #Tc@ 7.Ϫ|9 'z~|zq\; !F}{xuqlf]L2=ǯ~{yurmhb\UMD:- 5ϸ~|yvsojd]VOG?5-& ,}zxtpke_YRI@7/("  %nǧ~{xuqmga[TKC:2*# Cϸ~|yvsnic]VNF=4,% ;˩{wtpje^XQI@7.'! 2¦~umgaZSKB91)# *ƤqcXNE<3+$  #T̝t^K;/&  @ƽאzaH4% 7ͳ׃mT<' /Ӭ|{fN6! ({ݫ|eTLcL7#  "Gɴ驍v\C0)0eO:& ?ϰ~|{rY@(6fR=) 5~|zwtpjfclʍrY?(  }eU@++Pgplf`ZSKB;=Mjݕt^E.  bUB. 2"  -5. "/75."   $(%     biococoa-2.2.2/Resources/English.lproj/000755 000765 000024 00000000000 11455661313 020432 5ustar00scottcstaff000000 000000 biococoa-2.2.2/Resources/Info-BioCocoa.plist000644 000765 000024 00000001312 10464001431 021321 0ustar00scottcstaff000000 000000 CFBundleDevelopmentRegion English CFBundleExecutable BioCocoa CFBundleIconFile CFBundleIdentifier org.bioinformatics.biococoa CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleSignature BioC CFBundleVersion 2.0 NSPrincipalClass biococoa-2.2.2/Resources/Resources-readme.txt000755 000765 000024 00000000202 10404057133 021647 0ustar00scottcstaff000000 000000 03-10-2005 This file is here just to prevent cvs from pruning this directory, because it is now empty (just moved TODO)... Charlesbiococoa-2.2.2/Resources/English.lproj/BCGEODownload.nib/000755 000765 000024 00000000000 11455661313 023510 5ustar00scottcstaff000000 000000 biococoa-2.2.2/Resources/English.lproj/BCPlatformTable.nib/000755 000765 000024 00000000000 11455661313 024142 5ustar00scottcstaff000000 000000 biococoa-2.2.2/Resources/English.lproj/BCProbeTable.nib/000755 000765 000024 00000000000 11455661313 023425 5ustar00scottcstaff000000 000000 biococoa-2.2.2/Resources/English.lproj/BCSampleTable.nib/000755 000765 000024 00000000000 11455661313 023577 5ustar00scottcstaff000000 000000 biococoa-2.2.2/Resources/English.lproj/BCSeriesTable.nib/000755 000765 000024 00000000000 11455661313 023610 5ustar00scottcstaff000000 000000 biococoa-2.2.2/Resources/English.lproj/BCSeriesTable.nib/classes.nib000644 000765 000024 00000001673 11072757252 025751 0ustar00scottcstaff000000 000000 { IBClasses = ( { ACTIONS = { loadSeries = id; makeKeyAndOrderFront = id; modifyTableColumn = id; searchSeries = id; showGEODownload = id; showPlatforms = id; showProbes = id; showSamples = id; }; CLASS = BCSeriesTableController; LANGUAGE = ObjC; OUTLETS = { datasetColumns = NSPopUpButton; datasetTable = NSTableView; datasetWindow = NSWindow; inspectorPanel = NSPanel; inspectorText = WebView; }; SUPERCLASS = NSObject; }, { ACTIONS = {showInspector = id; }; CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } ); IBVersion = 1; }biococoa-2.2.2/Resources/English.lproj/BCSeriesTable.nib/info.nib000644 000765 000024 00000000735 11072757252 025245 0ustar00scottcstaff000000 000000 IBDocumentLocation 188 80 356 240 0 0 1600 1178 IBFramework Version 446.1 IBOpenObjects 5 24 IBSystem Version 8L127 biococoa-2.2.2/Resources/English.lproj/BCSeriesTable.nib/keyedobjects.nib000644 000765 000024 00000030332 11072757252 026761 0ustar00scottcstaff000000 000000 bplist00 Y$archiverX$versionT$topX$objects_NSKeyedArchiver ]IB.objectdata" 156<=AEW_wxy} !"./78;@CKLMPV_dijmrsux   ()+23;<>EF\`btyz "#()./4?x@CEJN_cjnw{./0w12345678H9<?d5HU$null  !"#$%&'()*+,-./0_NSObjectsValues_NSAccessibilityConnectors_NSClassesValuesZNSOidsKeys[NSNamesKeys]NSClassesKeys_NSAccessibilityOidsValues\NSOidsValues_NSVisibleWindowsV$class]NSConnections]NSNamesValues]NSObjectsKeys_NSAccessibilityOidsKeys[NSFramework]NSFontManagerYNSNextOidVNSRoot !<234[NSClassName_BCSeriesTableController789:X$classesZ$classname:;^NSCustomObjectXNSObject_IBCocoaFramework>?@ZNS.objects78BCCD;\NSMutableSetUNSSet>FVGHIJKLMNOPQRSTU ڀ܀ހ<XYZ[\]0]NSDestinationWNSLabelXNSSource `abcdefghijklmnopqrstuv_NSWindowStyleMask_NSWindowBackingYNSMinSize]NSWindowTitle]NSWindowClass\NSWindowRect\NSScreenRectYNSMaxSize\NSWindowViewYNSWTFlags[NSViewClass px_{{75, 746}, {480, 400}}_Gene Expression Seriesz{|YNS.stringXNSWindow78~;_NSMutableStringXNSStringz|TView.ZNSSubviews_NSNextResponderWNSFrame>VOW\afk<ss[NSSuperview]NSNextKeyView\NSCornerView_NSHeaderClipView[NSHScrollerXNSvFlagsXNSsFlags[NSVScroller]NSContentView\NSScrollAmtsMH2DNOA A AA>VDH<YNSBGColorYNSDocViewYNScvFlags0B C>V<_NSIntercellSpacingWidth\NSHeaderView_NSColumnAutoresizingStyle[NSRowHeight_NSDraggingSourceMaskForLocalYNSEnabledYNSTvFlags_NSIntercellSpacingHeight_NSDraggingSourceMaskForNonLocal[NSFrameSize[NSGridColor^NSTableColumns_NSBackgroundColor"@@"A @"@A>=Z{423, 247}[NSTableViewŀK0LCY{423, 17}78;_NSTableHeaderViewVNSView[NSResponder_{{424, 0}, {16, 17}}78;]_NSCornerView> V  7< ^NSResizingMask\NSHeaderCellZNSMinWidthWNSWidth\NSIdentifier^NSIsResizeableZNSDataCellZNSMaxWidth""B "B! ."Dz6Rid#$%&'()*+,-[NSTextColorYNSSupportZNSContents[NSCellFlags\NSCellFlags2')$#-YSeries ID0123456VNSSizeVNSNameXNSfFlags"A0%& \LucidaGrande789::;VNSFont<=>?WNSWhite\NSColorSpaceK0.33333299(78ABB;WNSColorBD=EFGHI?[NSColorName]NSCatalogName,+*(VSystem_headerTextColor<=N?B0(78QRRSTU;_NSTableHeaderCell_NSTextFieldCell\NSActionCellVNSCell#$W&'YZ\]^]NSControlView03/5!@012`45c"AP%&BD=EefHI?21*(_controlBackgroundColor<=k?K0.66666669(BD=EFoHI?,4*(_controlTextColor78tSSTU;78vww;]NSTableColumnz{|} 9"Av"C`8 ;6\Series_title#$%&'()*,-')$:-UTitle#$W&'YZ\]^03/578;^NSMutableArrayWNSArray<=?B1(BD=EHI?@?*(YgridColor<=?D0.5(78;\%NSTableViewYNSControl_{{1, 17}, {423, 247}}78;ZNSClipViewXNSTargetYNSPercentXNSActionEG"?}N&F_{{424, 17}, {15, 247}}\_doScroller:78;ZNSScrollerIG"?}ـJ_{{1, 264}, {423, 15}}>Vـ<_{{1, 0}, {423, 17}}_{{20, 60}, {440, 280}}78ɤ;\NSScrollViewUssЀP VQ_{{332, 12}, {134, 32}}$%W&'ZZ_NSKeyEquivalent_NSAlternateImage^NSButtonFlags2_NSPeriodicInterval]NSButtonFlags_NSPeriodicDelay_NSAlternateContentsT//RO@US\GEO DownloadPz|78TU;\NSButtonCell]%NSButtonCell78;XNSButtonUssX VY_{{14, 352}, {92, 32}}$%W&'ZZ[//ZWUSTLoadz|Uss ] V^_{{110, 12}, {93, 32}}$%W&'ZZ`//_\USWSamplesz|Ussb Vc_{{203, 12}, {93, 32}}$%W&'!ZZ$e//daUSVProbesz|Uss.1g Vh_{{10, 12}, {100, 32}}$%W&'4ZZ7j//ifUSYPlatformsz|UssACDl m_{{105, 356}, {168, 26}}&GHI'JW$KLMNOPQSTUXZ[VNSMenuZNSMenuItem_NSPreferredEdge]NSAltersState_NSUsesItemFromMenu_NSArrowPositionnA@@qpS~ ko/ K012`45_%&z|GcdefghiPklmnDqrs]NSMnemonicLoc_NSKeyEquivModMaskWNSStateWNSTitleYNSOnImageZNSKeyEquiv\NSMixedImageqrsSmwzyfuvwx[NSMenuItems{}|^Modify Columns{2|}~^NSResourceNameuvtWNSImage_NSMenuCheckmark78;_NSCustomResource_%NSCustomResource{2}~xvt_NSMenuMixedState__popUpItemAction:78HH;z|ZOtherViews>VQp<78GG;78TU;_NSPopUpButtonCell^NSMenuItemCell78;]NSPopUpButtonUss _{{278, 359}, {182, 22}}#$%W&'YZ_NSMaximumRecents_NSDrawsBackground_NSTextBezelStyle_NSSearchButtonCell_NSCancelButtonCell3/S q@BD=EHI?=*(_textBackgroundColor%W&'[S D@USVsearch__searchFieldSearch:%&'S[_#NSAccessibilityOverriddenAttributes@@USUclear>VԀ<>WNS.keysڀ݀]AXDescription_)NSAccessibilityEncodedAttributesValueTypeVcancel78;_NSMutableDictionary\NSDictionary__searchFieldCancel:78STU;_NSSearchFieldCell78;]NSSearchField[NSTextField\%NSTextField_{{1, 9}, {480, 400}}78;_{{0, 0}, {1600, 1178}}Z{480, 422}_{3.40282e+38, 3.40282e+38}78;_NSWindowTemplate]datasetWindow78;_NSNibOutletConnector^NSNibConnectorXYZ]0\datasetTableXYZ0]XdelegateXYZ0 ][ XYZ]0k^datasetColumnsXYZ0WZloadSeries78;_NSNibControlConnectorXYZ0\[showSamplesXYZ0%aZshowProbesXYZ0+O_showGEODownloadXYZ01]0ـ`abcdefghij5l6789:;<tu> ׀ր؀_{{346, 862}, {433, 270}}zA|WNSPanelz|F.HՀ>KVL<OPQRST<<WXY.\].[Preferences_UseBackForwardListYFrameName[NSDragTypesYGroupNameр Ԁ€>`VW<dLfLhi>kVh<oWqWssuvOA A B B >xVs<|hhH0Z{393, 230}78;[WebClipView78;_WebDynamicScrollBarsView_WebCoreScrollView78;\WebFrameView>@ÀĀŀƀǀȀɀʀˀ̀̀΀π_Apple HTML pasteboard type_Apple PICT pasteboard type_public.url-name_*NeXT Rich Text Format v1.0 pasteboard type_NSFilenamesPboardType_NSStringPboardTypeZpublic.url_WebURLsWithTitlesPboardType_NeXT TIFF v4.0 pasteboard type_NSColor pasteboard type_!Apple Web Archive pasteboard type_Apple URL pasteboard type_NeXT RTFD pasteboard type_{{20, 20}, {393, 230}}ZIdentifierVValuesSӀ>ޠ78;^WebPreferences78;WWebViewX%WebView_{{1, 1}, {433, 270}}Z{433, 292}^inspectorPanelXYZL]0ۀ]inspectorTextXYZ0]L݀^policyDelegateXYZ0߀k_modifyTableColumnXYZ0ဦ\searchSeriesXYZ0〦f]showPlatforms><sL[  P0QOa fk7\qWp78;>s0s[<0sssss0sP kq> L[ P 00QOa fk\q7Wp> !"#$%&'()*+,ZNSButton11YNSButton1VWindow[NSButton121ZNSButton13YPopUpList^NSTableColumn1\File's OwnerZNSButton12UPanel]NSScrollView1>:>=>@"TML<SUR0H [GPQOILKN 0QJsPaހ܀7W qfpk ڀO\>e"fghijklmnopqrstuvwxyz{|}~     %:058;7#(&+'.-1 6 9"3$>V<>>78;^NSIBObjectData#,1:LQVdf-?JVd!#&(*-/1368:<>GSUWqz"$&(*,.02468:<>@BSairtvxz(2>@BDFHJLNPUWYs!#,=?ACEGIKMO    "5>IKMOQSU~ & 3 O [ z      " ' ) + - / 1 3 5 8 C \ h j l n p r    " + 4 B K P R T V   ( 2 = I V X Z \ ^ ` e o  , : < > @ B D K ] j m o x  ,.024MZfh}.02468>[]_acenu'0;\eoxz|~'*,.D]fo|&;I[qsuwy{}"$&>suwy{}  %'DFHJKMOg13579;=?IRTqsuwxz|(:<EJLNPSUZ[]_abduwy{ !.:<>@O\kmoqy  ),.09>GVjy';Ncxz|~ ,] $:G]fq,5:M[dk  +-/13>GNfwy{}$&(*,.02468S\dfoq !*-/1NPRTVXZcfhj   , G [ d m z !!3!K!`!k!!!!"" "9"F"Q"X"Z"\"^"k"l"m"o"x"}"""""""""""""# #### #"#1#B#D#F#H#J#^#o#q#s#u#w###########################$$ $$$?$A$C$E$G$I$K$M$O$Q$S$U$W$Y$[$]$_$a$c$e$n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%% %%%)%4%>%M%Z%e%k%y%%%%%%%%%%%%%%%%%%%%%%%&&&&& & & &&&&&&&&&&!&#&%&'&0&w&y&{&}&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&''''' ' ' '''''''!'*'+'-'6'7'9'B'G'Vbiococoa-2.2.2/Resources/English.lproj/BCSampleTable.nib/classes.nib000644 000765 000024 00000000156 11072757252 025733 0ustar00scottcstaff000000 000000 { IBClasses = ({CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }); IBVersion = 1; }biococoa-2.2.2/Resources/English.lproj/BCSampleTable.nib/info.nib000644 000765 000024 00000000704 11072757252 025230 0ustar00scottcstaff000000 000000 IBDocumentLocation 69 10 356 240 0 0 1600 1178 IBFramework Version 446.1 IBOpenObjects 5 IBSystem Version 8L127 biococoa-2.2.2/Resources/English.lproj/BCSampleTable.nib/keyedobjects.nib000644 000765 000024 00000020616 11072757252 026754 0ustar00scottcstaff000000 000000 bplist00 Y$archiverX$versionT$topX$objects_NSKeyedArchiver ]IB.objectdata 156;<@DGKZbj   "(16;<?DEGJSTZ[adijmqru"'(1235>?CLMNOSTW\cdqrtv}~I  U$null  !"#$%&'()*+,-./0_NSObjectsValues_NSAccessibilityConnectors_NSClassesValuesZNSOidsKeys[NSNamesKeys]NSClassesKeys_NSAccessibilityOidsValues\NSOidsValues_NSVisibleWindowsV$class]NSConnections]NSNamesValues]NSObjectsKeys_NSAccessibilityOidsKeys[NSFramework]NSFontManagerYNSNextOidVNSRoot 234[NSClassNameXNSObject789:X$classesZ$classname:5^NSCustomObject_IBCocoaFramework=>?ZNS.objects78ABBC5\NSMutableSetUNSSet=EF 78HIIJ5^NSMutableArrayWNSArray=LYMNOPQRSTUVWX Q`{2uP I[\]^.`aZNSSubviews_NSNextResponderWNSFrame =cFVWOSP I`u{ [\klmn]opqrstuMMxyz{|}~x[NSSuperview]NSNextKeyView\NSCornerView_NSHeaderClipView[NSHScrollerXNSvFlagsXNSsFlags[NSVScroller]NSContentView\NSScrollAmts GB2>HOA A AA=Fx|zy>B [\kl]pVVUUYNSBGColorYNSDocViewYNScvFlags +< ==FU \kmpxxy}_NSIntercellSpacingWidth\NSHeaderView_NSColumnAutoresizingStyle[NSRowHeight_NSDraggingSourceMaskForLocalYNSEnabledYNSTvFlags_NSIntercellSpacingHeight_NSDraggingSourceMaskForNonLocal[NSFrameSize[NSGridColor^NSTableColumns_NSBackgroundColor"@@"A @"@;87Z{423, 207}\kpUzz}[NSTableView[\kl]pVVE +F=Y{423, 17}78Ϥ5_NSTableHeaderViewVNSView[NSResponder\k]pVV}ր _{{424, 0}, {16, 17}}78ڤ5]_NSCornerView=FXR2 U^NSResizingMask\NSHeaderCellZNSMinWidthWNSWidth\NSIdentifier^NSIsResizeableZNSDataCellZNSMaxWidth"B "B )"Dz1Rid[NSTextColorYNSSupportZNSContents[NSCellFlags\NSCellFlags2"$(YSample IDVNSSizeVNSNameXNSfFlags"A0 ! \LucidaGrande78   5VNSFontWNSWhite\NSColorSpaceK0.33333299#785WNSColor[NSColorName]NSCatalogName'&%#VSystem_headerTextColor B0#78#$$%&'5_NSTableHeaderCell_NSTextFieldCell\NSActionCellVNSCell)+,U./0]NSControlView+.*0!@25"AP !78-,%#_controlBackgroundColor=K0.66666669#A'/%#_controlTextColor78F%%&'578HII5]NSTableColumnULMNOQ4"Av"CG`3 61\Sample_titleX"$5(UTitle)+,U./0+.*0bB1#ef:9%#YgridColorkD0.5#78nop5\%NSTableViewYNSControl_{{1, 17}, {423, 207}}78stt5ZNSClipView\kv]pwxVVV|}}~XNSTargetYNSPercentXNSAction ?A"?sߪ@_{{424, 17}, {15, 207}}\_doScroller:78p5ZNSScroller\kv]pqwxVVV}} CA"?}ـD_{{1, 224}, {423, 15}}=F _{{1, 0}, {423, 17}}_{{20, 60}, {440, 240}}785\NSScrollView\k]p'MM J _K_{{17, 316}, {168, 26}})NTW,_NSAlternateImage^NSButtonFlags2]NSButtonFlagsVNSMenuZNSMenuItem_NSAlternateContents_NSPreferredEdge_NSPeriodicDelay]NSAltersState_NSKeyEquivalent_NSUsesItemFromMenu_NSPeriodicInterval_NSArrowPositionLA@@QPM^ IN* K2 !PYNS.stringO78ȣ5_NSMutableStringXNSStringvxN]NSMnemonicLoc_NSKeyEquivModMaskWNSStateWNSTitleYNSOnImageZNSKeyEquiv\NSMixedImageQRSMKWZY[NSMenuItems[]\^Modify Columns2^NSResourceNameUVTWNSImage_NSMenuCheckmark785_NSCustomResource_%NSCustomResource2XVT_NSMenuMixedState__popUpItemAction:785ZOtherViewsO=FTP 78578&'5_NSPopUpButtonCell^NSMenuItemCell\NSButtonCell]%NSButtonCell78p5]NSPopUpButtonXNSButton\k]p'MM   a tb_{{283, 319}, {182, 22}})+,O !_NSMaximumRecents_NSDrawsBackground_NSTextBezelStyle_NSSearchButtonCell_NSCancelButtonCellc.*M` esiq@$7d%#_textBackgroundColorxv))+O-./gbf`D@hMVsearch__searchFieldSearch:784&'5xv679:.</_#NSAccessibilityOverriddenAttributesrbj@@hkMUclear=@FAl =DEHKWNS.keysFGopIJmnq]AXDescription_)NSAccessibilityEncodedAttributesValueTypeVcancel78PQQR5_NSMutableDictionary\NSDictionary__searchFieldCancel:78UVV%&'5_NSSearchFieldCell78XYYZ[p5]NSSearchField[NSTextField\%NSTextField\k]p'MM_}ab v zw_{{14, 12}, {92, 32}})e,,hSjk.mnpy**xu@hMTDataŀO78up5\k]p'MMy}a| | z}_{{106, 12}, {92, 32}}),,Pjk.mnp**~{hMVProbesŀO_{{1, 9}, {480, 360}}78У5M_NSWindowStyleMask_NSWindowBackingYNSMinSize]NSWindowTitle]NSWindowClass\NSWindowRect\NSScreenRectYNSMaxSize\NSWindowViewYNSWTFlags[NSViewClass px_{{275, 453}, {480, 360}}_Gene Expression SamplesXNSWindowOTViewO_{{0, 0}, {1600, 1178}}Z{213, 129}_{3.40282e+38, 3.40282e+38}785_NSWindowTemplate78JJ5=YQWMM0UMNVMMUI  Q =YNPQ0RSTUVWXQ{2uP I=Y݀YPopUpList\NSButton1212VWindow\File's Owner^NSTableColumn1[NSButton121]NSScrollView1=Y=Y=YUM0VPRWNSXQOT  {2IQu`P=YG  p     =F =Y=Y78  5^NSIBObjectData#,1:LQVdf(DVam{&-/13579;=?ACEGIKMOQZfhjs| $-FHJLNPRTVXZ\^`q|1=FO[ivxz|~   ),.0{:FRauz|~   !*3GNZoqsuw    ' 6 A L N P R W \ ^ _ a f h k     % * 1 > F S _ a j o w   " ) F T V X Z \ ^ c f w | ~    $ 2 [ ] _ d i k l n p }    ' 4 A K c l u 8:<>@BDIKcloqsPcr(*38:<>ACHIKMOPRcegijs} +-279;=?ACER^`bds  ).7BDMPRT]bkz   '\oACEGINPUW^t} "$)+-/=ipy =?ACDFH_RTVXZ\^`gpr#0:GQ]_acegikmotvx 3<AJcegikmoqsuwy{} '3AJKMVWYb}  !,biococoa-2.2.2/Resources/English.lproj/BCProbeTable.nib/classes.nib000644 000765 000024 00000000156 11072757252 025561 0ustar00scottcstaff000000 000000 { IBClasses = ({CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }); IBVersion = 1; }biococoa-2.2.2/Resources/English.lproj/BCProbeTable.nib/info.nib000644 000765 000024 00000000704 11072757252 025056 0ustar00scottcstaff000000 000000 IBDocumentLocation 99 36 356 240 0 0 1600 1178 IBFramework Version 446.1 IBOpenObjects 5 IBSystem Version 8L127 biococoa-2.2.2/Resources/English.lproj/BCProbeTable.nib/keyedobjects.nib000644 000765 000024 00000003335 11072757252 026601 0ustar00scottcstaff000000 000000 bplist00 Y$archiverX$versionT$topX$objects_NSKeyedArchiver ]IB.objectdata) 156;<@DGKPVW[stx|vU$null  !"#$%&'()*+,-./0_NSObjectsValues_NSAccessibilityConnectors_NSClassesValuesZNSOidsKeys[NSNamesKeys]NSClassesKeys_NSAccessibilityOidsValues\NSOidsValues_NSVisibleWindowsV$class]NSConnections]NSNamesValues]NSObjectsKeys_NSAccessibilityOidsKeys[NSFramework]NSFontManagerYNSNextOidVNSRoot% '!( &234[NSClassNameXNSObject789:X$classesZ$classname:5^NSCustomObject_IBCocoaFramework=>?ZNS.objects78ABBC5\NSMutableSetUNSSet=EF 78HIIJ5^NSMutableArrayWNSArray=LOMN QR.TU_NSNextResponderWNSFrame _{{1, 9}, {480, 360}}78XYYZ5VNSView[NSResponder\]^_`abcdefghijklmnMpqr_NSWindowStyleMask_NSWindowBackingYNSMinSize]NSWindowTitle]NSWindowClass\NSWindowRect\NSScreenRectYNSMaxSize\NSWindowViewYNSWTFlags[NSViewClass px_{{336, 204}, {480, 360}}uvwYNS.stringVWindow78yzz{5_NSMutableStringXNSStringu}wXNSWindowuwTView_{{0, 0}, {1600, 1178}}Z{213, 129}_{3.40282e+38, 3.40282e+38}785_NSWindowTemplate78JJ5=ON0=O0N=O\File's Owner=O=O=O0MN =O"#$=F =O=O785^NSIBObjectData$)2DILZ\ 6CV]ky'*9LQ\]_dhu{ $8JTbp}  ).79>CE^i   %&(-.058Gbiococoa-2.2.2/Resources/English.lproj/BCPlatformTable.nib/classes.nib000644 000765 000024 00000000156 11072757252 026276 0ustar00scottcstaff000000 000000 { IBClasses = ({CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }); IBVersion = 1; }biococoa-2.2.2/Resources/English.lproj/BCPlatformTable.nib/info.nib000644 000765 000024 00000000706 11072757252 025575 0ustar00scottcstaff000000 000000 IBDocumentLocation 255 148 356 240 0 0 1600 1178 IBFramework Version 446.1 IBOpenObjects 5 IBSystem Version 8L127 biococoa-2.2.2/Resources/English.lproj/BCPlatformTable.nib/keyedobjects.nib000644 000765 000024 00000021231 11072757252 027311 0ustar00scottcstaff000000 000000 bplist00 Y$archiverX$versionT$topX$objects_NSKeyedArchiver ]IB.objectdata 156;<@DGK[cl   !$*38=>AFGILUV\]cfklostw $)*3457@AENOPQUVY^efstvxK'()*+,-./0369U$null  !"#$%&'()*+,-./0_NSObjectsValues_NSAccessibilityConnectors_NSClassesValuesZNSOidsKeys[NSNamesKeys]NSClassesKeys_NSAccessibilityOidsValues\NSOidsValues_NSVisibleWindowsV$class]NSConnections]NSNamesValues]NSObjectsKeys_NSAccessibilityOidsKeys[NSFramework]NSFontManagerYNSNextOidVNSRoot 234[NSClassNameXNSObject789:X$classesZ$classname:5^NSCustomObject_IBCocoaFramework=>?ZNS.objects78ABBC5\NSMutableSetUNSSet=EF 78HIIJ5^NSMutableArrayWNSArray=LZMNOPQRSTUVWXY P2`u{QI\]^_.abZNSSubviews_NSNextResponderWNSFrame =dFNXSTUW I`u{ \]mnop^qrstuvwMMz{|}~z[NSSuperview]NSNextKeyView\NSCornerView_NSHeaderClipView[NSHScrollerXNSvFlagsXNSsFlags[NSVScroller]NSContentView\NSScrollAmts GB2>HOA A AA=Fz~|{>B \]mn^rNNQQYNSBGColorYNSDocViewYNScvFlags +< ==FQ ]morzz{_NSIntercellSpacingWidth\NSHeaderView_NSColumnAutoresizingStyle[NSRowHeight_NSDraggingSourceMaskForLocalYNSEnabledYNSTvFlags_NSIntercellSpacingHeight_NSDraggingSourceMaskForNonLocal[NSFrameSize[NSGridColor^NSTableColumns_NSBackgroundColor"@@"A @"@;87Z{423, 207}]mrQ||[NSTableView\]mn^rNNE +F=Y{423, 17}78Ѥ5_NSTableHeaderViewVNSView[NSResponder]m^rNN؀ _{{424, 0}, {16, 17}}78ܤ5]_NSCornerView=FYP2 Q^NSResizingMask\NSHeaderCellZNSMinWidthWNSWidth\NSIdentifier^NSIsResizeableZNSDataCellZNSMaxWidth"B "B )"Dz1Rid[NSTextColorYNSSupportZNSContents[NSCellFlags\NSCellFlags2"$([Platform ID  VNSSizeVNSNameXNSfFlags"A0 ! \LucidaGrande78 5VNSFontWNSWhite\NSColorSpaceK0.33333299#785WNSColor[NSColorName]NSCatalogName'&%#VSystem_headerTextColor"B0#78%&&'()5_NSTableHeaderCell_NSTextFieldCell\NSActionCellVNSCell+-.Q012]NSControlView+.*0!@4 7"AP !9:-,%#_controlBackgroundColor?K0.66666669#C'/%#_controlTextColor78H''()578JKK5]NSTableColumnQNOPQS4"Av"CG`3 61^Platform_titleZ"$5(UTitle+-.Q012+.*0dB1#gh:9%#YgridColormD0.5#78pqr5\%NSTableViewYNSControl_{{1, 17}, {423, 207}}78uvv5ZNSClipView]mx^ryzNNN~XNSTargetYNSPercentXNSAction ?A"?sߪ@_{{424, 17}, {15, 207}}\_doScroller:78r5ZNSScroller]mx^rsyzNNN CA"?}ـD_{{1, 224}, {423, 15}}=F _{{1, 0}, {423, 17}}_{{20, 60}, {440, 240}}785\NSScrollView]m^r)MM J _K_{{17, 316}, {168, 26}}+VOX._NSAlternateImage^NSButtonFlags2]NSButtonFlagsVNSMenuZNSMenuItem_NSAlternateContents_NSPreferredEdge_NSPeriodicDelay]NSAltersState_NSKeyEquivalent_NSUsesItemFromMenu_NSPeriodicInterval_NSArrowPositionLA@@QPM^ IN* K4 À !PYNS.stringO78ʣ5_NSMutableStringXNSStringxzV]NSMnemonicLoc_NSKeyEquivModMaskWNSStateWNSTitleYNSOnImageZNSKeyEquiv\NSMixedImageQRSMKWZY[NSMenuItems[]\^Modify Columns2^NSResourceNameUVTWNSImage_NSMenuCheckmark785_NSCustomResource_%NSCustomResource2XVT_NSMenuMixedState__popUpItemAction:785ZOtherViewsO=FOP 78578()5_NSPopUpButtonCell^NSMenuItemCell\NSButtonCell]%NSButtonCell78 r5]NSPopUpButtonXNSButton]m^r)MM  a tb_{{278, 319}, {182, 22}}+-.S !"#_NSMaximumRecents_NSDrawsBackground_NSTextBezelStyle_NSSearchButtonCell_NSCancelButtonCellc.*M` esiq@&7d%#_textBackgroundColorzx++-S/01gbf`D@hMVsearch__searchFieldSearch:786()5zx89;<0>1_#NSAccessibilityOverriddenAttributesrbj@@hkMUclear=BFCl =FGJMWNS.keysHIopKLmnq]AXDescription_)NSAccessibilityEncodedAttributesValueTypeVcancel78RSST5_NSMutableDictionary\NSDictionary__searchFieldCancel:78WXX'()5_NSSearchFieldCell78Z[[\]r5]NSSearchField[NSTextField\%NSTextField]m^r)MMacd v zw_{{14, 12}, {92, 32}}+g..jTlm0opry**xu@hMVSeriesǀO78w  r5]m^r)MM{c~ | z}_{{105, 12}, {93, 32}}+..Ulm0opr**~{hMWSamplesǀO]m^r)MMc z_{{198, 12}, {92, 32}}+..Wlm0opr**hMVProbesǀO_{{1, 9}, {480, 360}}78ң5M_NSWindowStyleMask_NSWindowBackingYNSMinSize]NSWindowTitle]NSWindowClass\NSWindowRect\NSScreenRectYNSMaxSize\NSWindowViewYNSWTFlags[NSViewClass px_{{181, 499}, {480, 360}}_Gene Expression PlatformsXNSWindowOTViewO_{{0, 0}, {1600, 1178}}Z{213, 129}_{3.40282e+38, 3.40282e+38}78Ƣ5_NSWindowTemplate78JJ5=ZRMVQN0MMMXMMQ Q  I =ZN0POQRTWUVXY 2Pu{QI=Z]NSScrollView1\File's Owner^NSTableColumn1VWindow[NSButton121\NSButton1212\NSButton1211YPopUpList=Z=Z=ZNO0RPSXMTWUYQV P2`I u{Q=ZI !"#$%p     =1F =4Z=7Z78:;;5^NSIBObjectData#,1:LQVdf$6Rdo{*4;=?ACEGIKMOQSUWY[]_htvx  *2;VXZ\^`bdfhjlnpr '4GS\eq !#%')+-/146?BDF .P\hw!#%')+-7@I]dp    ( 0 = L W b d f h m r t u w | ~    " $ ' 4 = B I V ^ k w y   - : A ^ l n p r t v { ~      % . 7 < J s u w |      $ 1 6 8 A N [ e } "-RTVXZ\^ce}j}0BDMRTVX[]bcegijl}#-8EGLQSUWY[]_lxz|~ &:CHQ\^gjlnw| "#%'Av *[]_achjoqx  -5:<>CEGIW!-:WY[]^`by!9nprtvxz|  "$;DK|!&(*Eajsu~!#%')+-/135>WY[]_acegikmoqz#$&/LNPRTVXZ\^`bdfhjs<biococoa-2.2.2/Resources/English.lproj/BCGEODownload.nib/classes.nib000644 000765 000024 00000001007 11072757252 025640 0ustar00scottcstaff000000 000000 { IBClasses = ( { ACTIONS = {downloadSeries = id; retrieveList = id; showSeriesInfo = id; }; CLASS = BCGEODownloadController; LANGUAGE = ObjC; OUTLETS = { downloadPanel = NSPanel; downloadSeries = NSTextField; seriesTable = NSTableView; }; SUPERCLASS = NSObject; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } ); IBVersion = 1; }biococoa-2.2.2/Resources/English.lproj/BCGEODownload.nib/info.nib000644 000765 000024 00000000705 11072757252 025142 0ustar00scottcstaff000000 000000 IBDocumentLocation 275 48 356 240 0 0 1600 1178 IBFramework Version 446.1 IBOpenObjects 5 IBSystem Version 8L127 biococoa-2.2.2/Resources/English.lproj/BCGEODownload.nib/keyedobjects.nib000644 000765 000024 00000016437 11072757252 026673 0ustar00scottcstaff000000 000000 bplist00 Y$archiverX$versionT$topX$objects_NSKeyedArchiver ]IB.objectdata 156<=AEOWekl !$)=>AEV^_diltuvy}   ()-./235678;<AFGSUamyz{|}~q~U$null  !"#$%&'()*+,-./0_NSObjectsValues_NSAccessibilityConnectors_NSClassesValuesZNSOidsKeys[NSNamesKeys]NSClassesKeys_NSAccessibilityOidsValues\NSOidsValues_NSVisibleWindowsV$class]NSConnections]NSNamesValues]NSObjectsKeys_NSAccessibilityOidsKeys[NSFramework]NSFontManagerYNSNextOidVNSRootz{|x234[NSClassName_BCGEODownloadController789:X$classesZ$classname:;^NSCustomObjectXNSObject_IBCocoaFramework>?@ZNS.objects78BCCD;\NSMutableSetUNSSet>FNGHIJKLM  'OtvGPQR0TUV]NSDestinationWNSLabelXNSSource XYZ[\]^^`abcd_NSNextResponder[NSSuperviewWNSFrameYNSEnabledXNSvFlagsVNSCell  fXZg.ijZNSSubviewsUmn_{{14, 192}, {167, 32}}mnopqrstuvwxyzz|V~_NSKeyEquivalent_NSAlternateImageYNSSupportZNSContents]NSControlView^NSButtonFlags2_NSPeriodicInterval]NSButtonFlags_NSPeriodicDelay[NSCellFlags_NSAlternateContents\NSCellFlags2 @_Download GEO SeriesVNSSizeVNSNameXNSfFlags"AP\LucidaGrande78;VNSFontPYNS.string78;_NSMutableStringXNSString78];\NSButtonCell]%NSButtonCell\NSActionCell78;XNSButtonYNSControlVNSView[NSResponder^downloadSeries78;_NSNibControlConnector^NSNibConnectorPQR0UXYZ[\]^^abc  _{{14, 88}, {167, 32}}mnopqrstuvwxzz~]Retrieve List\retrieveListPQR0UȀ&!XYZ[\]^^abcπ " #_{{14, 56}, {167, 32}}mnopqrstuvwxzz~%$!_View Series Info^showSeriesInfoPQR0(MNX[Y\ab_NSIntercellSpacingWidth\NSHeaderView_NSColumnAutoresizingStyle[NSRowHeight_NSDraggingSourceMaskForLocalYNSTvFlags_NSIntercellSpacingHeight_NSDraggingSourceMaskForNonLocal\NSCornerView[NSFrameSize[NSGridColor^NSTableColumns_NSBackgroundColor"@@+)"A @)"@L/*I3HfXYZ\   ]NSNextKeyViewYNSBGColorYNSDocViewYNScvFlags_00(@(` aZ{140, 190}XY\b[NSTableView(-,,.fXYZ\  i00+@+jaY{140, 17}78"##;_NSTableHeaderViewXYZ\'b(0012fXY*Z+\,-./0^^67b89;<_NSHeaderClipView[NSHScrollerXNSsFlags[NSVScroller]NSContentView\NSScrollAmts^ )/,kfrb)lOA A AA_{{141, 0}, {16, 17}}78?@@;]_NSCornerView>BNC4GFGHIJKLMOPQaSTU^NSResizingMask\NSHeaderCellZNSMinWidthWNSWidth^NSIsResizeableZNSDataCellZNSMaxWidth(5"B"C ?"DzFWopvxXYZ[\][NSTextColor8:76>_GEO Series Accession`c"A0 efgMhWNSWhite\NSColorSpaceK0.33333299978jkk;WNSColorkmfnopqrh[NSColorName]NSCatalogName=<;9VSystem_headerTextColorefwMhB0978z{{|];_NSTableHeaderCell_NSTextFieldCellWoqvx z@C(E!@kmfnqrhBA;9_controlBackgroundColorefMhK0.666666699kmfnoqrh=D;9_controlTextColor78||];78;]NSTableColumn78;^NSMutableArrayWNSArrayefMhB19kmfnqrhKJ;9YgridColorefMhD0.5978;\%NSTableView[seriesTable78;_NSNibOutletConnectorPQR0PsNM^_NSWindowStyleMask_NSWindowBackingYNSMinSize]NSWindowTitle]NSWindowClass\NSWindowRect\NSScreenRectYNSMaxSize\NSWindowViewYNSWTFlags[NSViewClasspRSQoq pxrT_{{418, 304}, {360, 240}}_Gene Expression OmnibusWNSPanelTView>NVȀ V0!GXYZ[\]^^ab W ]X_{{183, 200}, {157, 22}}Wopqvxza_NSDrawsBackgroundY[V EqA@kmfnqrhHZ;9_textBackgroundColorkmfnoqrh=\;9YtextColor78;[NSTextField\%NSTextField>N97)bf,/G>Nހ(G_{{1, 17}, {140, 139}}78 ;ZNSClipViewXYZ[\abXNSTargetYNSPercentXNSAction000c e"?;H€d_{{141, 17}, {15, 139}}\_doScroller:78;ZNSScrollerXYZ\,$b~&'000ge"?}ـh_{{1, 156}, {140, 15}}>*N+G_{{1, 0}, {140, 17}}_{{183, 20}, {157, 172}}78011;\NSScrollView_{{1, 1}, {360, 240}}784;_{{0, 0}, {1600, 1178}}Z{213, 129}_{3.40282e+38, 3.40282e+38}789::;_NSWindowTemplate]downloadPanelPQR>0VuNPQR0CހwN(Xdelegate>HR^CV 0V4(! Py78T;>VR^^^^^0P (0 y>bRC0V0V4(! Py>nRopqrstuvw}~y]NSScrollView1ZNSButton21[NSButton211\File's OwnerYNSButton2UPanel>Ry>Ry>R^0MLHVICGKJހ vt0PV 4 O!'(y>Ry    >NG>Ry>Ry78Ƣ;^NSIBObjectData#,1:LQVdf &8CO]y!#%')+-/13<HJLfox   &4<EGIKMj|*<OYdr "3:AJOQSVclqxy #/>GNfu   (*7HJLNPmoqstvx      d ~  & 2 > M a f h j l q s t }    * , . 0 2 4 ] _ a c e g i k m w    ' 5 B D F H J L N P R T V X Z m   " - / 1 3 8 = > @ E G d p r t v x z  (*,.029KX[]fq ,.024GPYbgu~ !(?PRTVX "$&(*,135Pjs{}(*,.0235>CXZ\^`v&1V_irtvxz{} #%'=W`iv  "$&79;=?HQdfhjlnprtvx  $/;HRXabdmnpy   "$&(*,.09:<EFHQRT]bqbiococoa-2.2.2/Documentation/headerDoc2HTML.config000755 000765 000024 00000003472 11065776416 022410 0ustar00scottcstaff000000 000000 copyrightOwner => 2008 The BioCocoa Project.
defaultFrameName => index.html compositePageName => CompositePage.html masterTOCName => index.html apiUIDPrefix => biococoa TOCTemplateFile => headerdocBioCocoa.tmpl styleImports => a:link {text-decoration: none; font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; font-size: small; color: #0000ff;}a:visited {text-decoration: none; font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; font-size: small; color: #0000ff;}a:visited:hover {text-decoration: underline; font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; font-size: small; color: #ff6600;}a:active {text-decoration: none; font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; font-size: small; color: #ff6600;}a:hover {text-decoration: underline; font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; font-size: small; color: #ff6600;}h4 {text-decoration: none; font-family: 'lucida grande', geneva, helvetica, arial, sans- serif; font-size: small; font-weight: bold;}body {text-decoration: none; font-family: 'lucida grande', geneva, helvetica, arial, sans- serif; font-size: 10pt;}code{font-size: 11px; font-family: monaco, courier, monospace; white-space: pre;}code > pre{margin: 20px 0; padding: 4px 4px 4px 14px; background-color: #F1F5F9; border: 1px solid #C9D1D7; font-size: 11px; font-family: monaco, courier, monospace; white-space: pre;}font.param {font-style: italic;} #textStyle => "" #commentStyle => "" #preprocessorStyle => "" #funcNameStyle => "" #stringStyle => "" #charStyle => "" #numberStyle => "" #keywordStyle => "" #typeStyle => "" #paramStyle => "" #varStyle => "" #templateStyle => "" useBreadcrumbs => 1 #externalAPIUIDPrefixes => apple_ref #externalXRefFile => xref biococoa-2.2.2/Documentation/headerdocBioCocoa.tmpl000755 000765 000024 00000010545 11065776416 023006 0ustar00scottcstaff000000 000000 The BioCocoa Framework



$$frameworkdiscussion@@

Classes


$$classlist cols=1 order=down atts=border="0" cellpadding="1" cellspacing="0" width="150"@@

Protocols


$$protocollist cols=1 order=down atts=border="0" cellpadding="1" cellspacing="0" width="150"@@

Categories


$$categorylist cols=1 order=down atts=border="0" cellpadding="1" cellspacing="0" width="150"@@

Types


$$typelist cols=1 order=down atts=border="0" cellpadding="1" cellspacing="0" width="150"@@

Constants


$$datalist cols=1 order=down atts=border="0" cellpadding="1" cellspacing="0" width="150"@@

Header Files


$$headerlist cols=1 order=down atts=border="0" cellpadding="1" cellspacing="0" width="150"@@

Function and Method Index


$$functionlist cols=2 order=down atts=border="0" cellpadding="1" cellspacing="0" width="150"@@

Copyright © 2008 The BioCocoa Project.
BioCocoa is licensed under the Creative Commons Attribution-ShareAlike 2.5 License.

Creative Commons License

biococoa-2.2.2/Documentation/images/000755 000765 000024 00000000000 11455661313 020020 5ustar00scottcstaff000000 000000 biococoa-2.2.2/Documentation/images/BCBanner.jpg000644 000765 000024 00000073643 11072512362 022143 0ustar00scottcstaff000000 000000 JFIFddDucky<Adobed        !1AQaq"2RB#Sbr3C$4%csDdU5E“t!1AQaq"2BR#bS3rC ?!o!]Pߴ4P@`[^$$oT@¹| #5*-HմMm*8¡$޴Mh)",R#@@ID pHA И#S$e!U08nLJip&" "v$';AiQ Q!Lu\ԓ@J:|w+6l:р:㭧H[]? yl`hmp0l4GjOPM,җ|CTzaᴐTZ$E.Zj32=c.1K.sSe.l$`ىJEEn Hsz] frc/ǀתJ@[Ls\2ǽjKBY23lF1CҚ4FbЫ+>:$E`4LDI44h$h 訲-LT(A9#)NP*A&ᦪ&j!29P2bcx*XĉҐ1r6lLyEbPQhiGnvi O4'Z7dKb;̼ va?}IJQ!"uH --_\)ce˙|%2GJϓ7,ZSr b9?K6;禮#q6BÌ0P>9dQkB_2$@pCŋ;ݿjJi:iY ^MsQ-:)oǠ?RW9u^lyv*D dp:=MM;ŋ|ŏḿ Tyn6=*{֗'iz7/C(ݜp)8H[#ꀓO73K !j2H5:[d5KU6ujt8(KUM$nR(!kZ52,2#8S.($!iJB bh]Uh-cJ#x]HA ԔI! hJ+u@ iP:=w t\H*Ȁ.ykC:`3o`Ƹ.Uj ?K%4ͿYX7>ݿُ8I)Rp6f_2%흃M7d>"=֝E+״ˉ&cx7CcIj,wONjukF;5DN>TjXg𾚅&E0ֽE367e ۵knjlҶfs1MVH;$mY^BdГ433'f/P[9a`^NZ2v5 ,g^v z[acu1!A=`m͓yص7+֡X)ļԦ/*i:Od8ռajA3N+WzԚd9*NFITRBشS29IDaPh$ J&E#*B蕈"5@Б"V(X!L:F -rΣW*&]T^y3͹p$5ꡞơ-YVyQY .`xIghq0R;d$zXFwfͯF K1=)HAFCl='z-b!y*lO>>ҼV?ͳ}MN$Wǒb(YE 6'R 꺖SyYA +C40C9717"[f Fp/E2'#5jEW٤$GNũev*݋kSsM]Z-.0ZSV&KțxEL1ôvqE//uUSg "iV^\w"C%qt[4>;/VKI+-JΎ@hvj+u`ܥ#&z6z]I+m-8Qx%[Vv1qpalXD͑M@=~D}V H28B8xEBO౟2kmbm`~V|晬hḃ{7ULm1r8k4~#LC"-ǖzӏ<\L9^^zВES%>:+YA@n.:+VJY*?pcۤmlڑy=ebǍ+|/oW~HOɰl<zBe#r륕\Y_#ΤƤJ3a-#RX(Dj;SioSQ%0"ɱ<{j8}E:L?Ihǵ{:ly "! {J6ؕY$E~_Mɤ-3FsYxʧ1T>Y^ [5atZJ YxEB2-1Pw. +;VUVbeZk)E[&Mvɡ?R8(FelAϞr'zb"2РuP$6R* Up2hI |9XO,Lo0;֓@hA [$\mQ&Fe H$2XG&s^+|TqïcSVbx˟M#?Eq巇fgq˿@y4sM̱0 릿jOi"m|"L챇ka|ˣ~vst´#3G#vkQѱOk*}8.u#dၩes#̧[M {kدDo29mdR]Hؠ874kETU6EU| ,_ӨjjF`̎^;>B]MjwbЃԹ-$hkAE-I6>Ȋ:Llc|mC._w:=19r..,wr_ӣ0sVv hZp٧V|ukC˼}FA]WMhpscuz,dٖA d<ޝVH.xM#x R5,W8+b1/6^i vKrz3rVB 'G֭nFBk[Tη-cY;uş"oBuZ?eheUskMUmG9i)̋s3TK C(>bpy PwR9/!G'o'Y?y=(tay})+&>~8},a{IOAo"Q}< ~$HCˑ[!4,1oG-Ȝ1uSHd*6܏JfÛVYiꅝ><[ц`BցIB"܎sENHins\e܎msI[0{#㜅o3u+yq$IoR֪y8Hײ{(c0;QƍbjJڊXҤ(,GJt*rSsK ;?j;G@ oξyis("/G*WJbwp@''q-h dE Og=4 <א-ۭͥ$y-hFXXkdqV%a 4--6cf}XIYԝ-YK|:8JJz[yXw.[*|tEWk6doqIkN*X/lkq="BT W|m-ľf}=H3.L!0'ิ /N7'/=|&2ݫ{ Vж(1M" 5PBKҘ(޲Us6=q CŒYWoJGňm:~FZzv{nK9FZ 94Ԑz!L u)xdaMZMY[3f9C"&q·ҮuvSixA\5(֞ˇ\Uvݫ k4׶kvG3 i [)Dٵ^&Bi\T]bV܂(lZj̗Qn{YHZ lG{V֜0_}l(*(U]ǣg976giMFr˗_75i4cN5۳W|$+dp4֠ðٕ( Z0?:Fa ŏ*vܕӜ˹})8s1J= lcfrqOT~5-[@:*,ƔYE3kUOɬ'oշI7Gz,2 \ޢcYjN>DRnXԿiY$>&s4RGG}Ԏq$?mX v'<쪟",Q,Na(ʙm(w'qjvOSpfsE\n,+3mg|1梫|0ySfݧ; bXo㾔H/gᴿ_*/UFùZKccZ?bG}@(T7.8$-|/ MGrٙto]Ajz( Z];!6<$NnM|QaWr(Q2#H!1 DI#@I̫kP Y ,ڱFl.*HLɾWЪ<妦k8tS!f1cADB H<ĘIj ldaϖpЪs^ISNN95ߔ cO#իO<d/[?$pru)wڶUI _K.'BrWx{ 8U#kd;[g\m#l-h|, e),cytKdn=dXfݖ@[ 3ԗ7b1+_)sExW {m4RjǙ՝7!6O0|m5\&t=[dV-ճZqYj55Tb!`\^Qjc|fH_٢EۍVAP& LJ tֶqfWg브ևx6/N/徟gSNK榿wrAu&{Fq"F},^6X,Jغ14 =- e#N 0 !Q7N;p^9"_I,&OCG!ҽJ/iV;Ò0adnGð_r53* .%Hw{RhdtW:qV;ew,jkc7vYV8[hvteu|rf礼cn*OWKV\-س+{_biydw8t*]YՂrhv2@ӨФ!vN8oaءliJh3d+wa}W^xބM=tdomv0zF֮.A /<ӘY[nݗߙ:}+OCzrߙawUjɟ7|%o+ -HղHj9ЩD95tfMYOplP>gv 3Bj7k-̎pp] xUL.͜>[6^]^#>,cejIm V.n5nai<p*8Br; .S'.N[9rmRv[\{~.>6;VZ6oՌ%~jQIGo[/- \Yr8xV;գm,1L6Ъy\}) ` ;VNhPz/naijڬG3\* ͣjA3NN;[P&"m`+ZIVֶȒ9bn[u~fy3OK{OOO*EupN]HlZI\:&mZSH1pj(,ŢPJKq<$-{j:B(DcsN!( "|R@I",gyiQ0V4{SlnYcdhӥh)&YE(ZL oHm-2JnZ9%v<4V22Q ju=n'١P̆YG{UHEIlm$QAѢ޶̼ؖchrul{9FyRz/ ^OOOCuo[̴*Q]kUe٬Y+bPI@Y\5RjP#99J`,e6n4kU~%  dݝSHJᴚT4] 15!#P2̌mթFŝ-(Pa^XGf2)6e&j; #>8ich*ԥ wRӮI\A6F,)X6,mCEU,nC MCʼnR.\a^eIrE#"MuH7.Pj'a^+wG+r{ Z] #b<&FA!ph(=jNɶ֭]=$ZVmM|El`:/SG0>cL28n)C6;Pd[E,n/h5Zy4g⠡5V1'dPکni"lZ5bΘv:vN2듹#F7Zf{\ZPD0&BJr_GzB0^1f˹r|r,6G!:8Z)f*KG9;YGo Xu vXD@$2F64e᠃;U4ӔNd'!˷H6\7-sI&3;ьn w wӻWc?7'<|6O$uMHZϏ'-פj9 Lh;Qmuwh8^in*Ifծn^F΅mU:c/yfrCq C#F9@:֮E+kVr11p:" A_.Ov`ϓHD2.o]R$%̲i|8267R8T/uTR[q?M,q͛yӱR=}UuVKw4;[4<{Nx~ieFLqn]^ڣc(^iu#E3V $x=/ʋu )^߸+)!I)a;؍;nW Kf>IZ uAV[eUblĬ;kժ'nՙL5*D $P@ U?Pb( ]I HC {`L @UPCA  q@ %2# 0!2JFYdlKf h`:#36"uޜ-Yl㬳 A#ES/NWۻ 8.j6>?RǓbyzB|#jHz礪:+Jǔo|'6!z4QDY8Ż,^ٻ@./wG:SKWv[+u_mNueՠFS&q ku(JYC&S-r,w}} 6hG+,["t`FA<,Ά6@?gTe5HkNкid)%b`J3 ZU7j[G%h?\?_Ҵc:NJ(~v~>g}Te[Qƞ #\<q ʐj& 49@1nE\{- IUWo-/wHֺ-C~O1`\c "vz?bcW%3b.r䫜 ͸wb'[]7(v{-_\@T@ P ,6WP&rL/kfPɷJؼVlP.<%{_eu֦8Q8еz=vIeqVIK"c\ZDGBO{`G&62f&AB{޴I%S>kUA6"F.q/V~ޅwc}t)2ƊκFҝ;CdOciFa$N^UPGݛ݁HLB$(B@@ T@ Q$@cr!yA!@ 5  C P1U44ƔPHLAde #zӆ6ZT% WH?Zb -M\fgVW]G=?AaYo!FSѠ\?@k[=Mv4s>=2͙Ÿh[zH9oDC*襜[Mh4 UBη.AE",sZQlZbSu;EGbRN,X<07ɖxۓ4ugm[36??6?ho/I~XMy2KV1h5йz!c ,v>-] SV{=[zi|^x.odsζQZgRy謼N)tW]4Hn'h>UTjTN5 5$$&[>3:YҋVPeYX'흽nekٙ){1p3lۍpӎhҾ%F9WR){J@MV 44eבmZtrTI9v.-uX Շ1Mz?ӯ16-LHyy,Vqt~CE܎5C;urĬm:5(HS !`$ HyzպP:ّUڃLc{x־+Lm_JY{y,w uPw(IvNH-;[ 4`;1jϟ7 ]d+rrߓ,QZT* DLB@$p@0@@ 6Ea@jHi@i@b-ZGOާ^Ћn%F@oR J W +JYS;W5f66s^ں4%Twp[[G-wQ$/͎(et HC"{i{M=iYJzg3Z| Y.m#YϵbYkdj5lOz,ӯ9K\NDہ(JJu jFQ|e-;A'*NPD5֮wpi5-xd_Zr]q 8n+t `v[ƺ0_O%W ^Oɲͷ}*44]zJfXA]%kS( h.تY'FAۘ|2C.{1笮KtIi8՜VASˊ~܋|Ɉxl%^ʹj(u*qYt[u1j"S3 B&a 7hjI&]kn]iv($_UZG ^aoK$Za V,Qz G}az< 3?QCU1"ά`6qo\ڴ]\em"4iLak#!`C4Dr61Q }[Z1ӊ3^ܙ%S"W|i%!o'K]V#N:X96Q5Idm" 89>P]TL@T@ D   m@A@TPP P P1 ca@CHLD9p dۇ%ʯZ J]8sցwis{yM\Еgp+Թk}N GC$#QK82A_,L32̤ Z_fYy3# Culaf2#g+N#^4I@Om1rídff<}l(sq>9]q׹6K0Kg5[%*ժ4[lBidծ]6sR@qP@ p "ݯ05dXؿvn22hseNlOl$ڽܫ'6nx*Ge-x32{;-o $[JTi@XP(@7nҡdI1y7V 'kJh5([tt5V-|D>eˇzu rX>aw?;R|nIbRLaja T@{[`C`s'w[;g#/y1]7ZJ_2C |oӞ\nK&2>̇vI([6cx:?O[Zl48[pR;ֽP\':?H/R7c'.縹Ʈ:We(P3s'"@  :HHDiDT@ ((" C !4 B` "@/x[ʲZ5I(F& dn2<4j2`彴, ?t/-[Iq: 9uC?mqہNVgdS׿ƙslzB_7vkYy^8S<jEIᯄ_F]sY6tqOݕuQgNzog+Qr~gKJ{?htQ{Quҋ>Ry|4kRf|-椳[':22i\'-ѷu<^Cۄk2VdCz8`h}*Y\Ei[66jX?wre-0\ ! p4UgIi[aqvqZ/W<5Zvf|drf6&]uE3㳥L1o~]׵,qreʇ"R+ ) tzq_y*-L6p8@Jm ;nrʗ6m.J=Z+IThZNrG#'Vt&P|m'YajǗՏ"r-#sS$I>eͶjd:^Jӳͧef:N%U+2R8"t#4ysyali71i*u_n(Ne-'35{Z$Ȼ=6H5$%L6wJ)8onq. w5]8:c+?0MQ2V,#S#:>%d]MfNv#ia,Jwbd槞hٟfN48鼍맗8f w佨[^Z+i'rh^™F!#) QcB *ޢ4m[$oD ö)ٮVltJO7.T ̚($$. O[/iVl.>\括|ch4e: [&|QVγ[tlU?ʱM8ΏrA FZe1s 1u%{7} ִ>bsmʾJ`IHHjLNjBRI9~lBaaaW 긟U_tN{l-Ą s..ȅqfJȞ[W䬣wer[8dej,͋iizN̕o|~zv5t9FYye,v r3A$$^DBIk`D[\Hkmp8diرfjX:2$f>*'}|6=w97*X<\ I xS.ۍ:Z(܅ќDz/fzKD.%[ ;ŕl7p?z-M<1ߣ-w#!4E9M 92$0=xR"Tq 'u;wrvg t:ђ??g)n>!#JM[W_h9C*܆"3Y!cpZ$\ҘA",@ 1;ɛQ|L\2)@{V;tך-#4Y. |CLyݡ&wRϏ^ߒm;/!C r\DE $nک.IDJ+"DJАX%iQdB$scnZYI}Fl/UM4{WI#\I$IAF k`͔ioUeEn<|{PxCXZѠl .ƝjA:)UIhOEa$1&! TAHaCP T 5@ U P!U$j U!P5LBU@9 8x) {JLP0!j r<ŐplS6KxJ%3BR8"t-hKҳf~:b-7M$Dր6NА jC0 g$ewZWmW,Mvg͓c=[SR~heC~miV%$x ! 9i+*INfLo/fF>06f`ܧFܴ{ޱd_ZZ&l )RZ(b$P85 "Hjg`띒N5k:*w!kK8:U`(1#h 509rW:ݚ'GP*7w;{8`D(|Ybn;TY!k@h*@P Rj R$jPUH *T %0J51zӃf#s֒jv@wzR8lO;(lO;(~wzR81_މ/NJB u'w#eH@Ᏺ?F>wB?]މF> T[ t#cYc*޵VS)F; 8\o'ɇ&`pOz%Sr9'wujulmZGOwzK+Os=&m +Os=#37ڰoU# 9+wRۍ:U4ekE6d'tu3MNvŗ^Gmj5i;VeLx>ޢJC־{ 6{%{}T=m>FBQZG"::CWƜKzv;keGǟnBSO+Tx~Z9l-tkdQW^iG'H~F O]ޥ"#69 v>w$`u"'p'VүvUkx#3ղ 8OD8`މa#K";g >oC&^*Yf<\#hd 2=q$$iXr7$nKnY*]S׵J~$-blO;\Um'wBq_ޔ 8/NNBÄrD6ϔRBRMi$M:<=G 8<28 e.$Q!~*Տ,|%iA!m'w#|wB]ȋFOeQ!5 +Jt֊<טd!X6 NB/NND/Y~wz$auJ@_-?H@~[ek#|!uD _ޜoˬO;u'w Y~wz$P/~wzr~wz$ ?؆$H I5@T5@! U!uz7*)9I'z @]@d(]:xbJfh5qƍwj@䑲$9%$9+eA:+fYI^7<^- Q:|2z`{Qne5mbFر%^j $FT@i&XGE VZ#Ɖ+cJB:P#/4,e4cXC^JUo3bs;3I?j+0v$bؖ\-e{?](Xo<]ܷ yw;>r{sb8۵ Q#yX-Z^K坌)[R/) $"$@I=.5 )@PɑQK,Ǎ6{V mI!عֳoUT!8=l_Z+Q@(4jP@P#H6*9UYK1<̹mex@Mx+Czֹ('G#lN5^n.ctv0Iw;YQCZo܋Y UٮVd.Y#q<]h+)+Hr{y/<جKyp6CRO\sVWv;-:KBL6"-z- (]YZRIRn}?7X읞Hڴxm+]lUT T HRo L&Hb@!9!$rĘ\':6qy;$WE,"R0H& \`p(FܮUxG*hh=<=C#p(ސ=wR'twYjz2SWB L,LąFka-J"D@"D@q ɵ#G ,-3^7֪}C+z:[Nkz)_u>veikim}+'O'lCY_y1Lj) )iLC LCjׁFVTmMMj͹3O^7VΎ5sxيY65}z4[um9&hE3͠{Z#Z+Zǀ2=&؄FȯcslM8%)iYC)xQMv)uz9.ʷh#-\@nŚeǁt/!w}'G[ƫ];nU@ DF -[Xt.?nJW_u{6UEqbw"sZۆD崊;ܰ94- H$cxqtVVAذD5LAUHTŷW WScK-`h0k &A^:ӣ1yV.w.=c}*VsR5_.#S &0BoqXBk3k?4s})ľYYr[p(zKI#=/ 4k_$P=-,o$$NY ;xvp4}+c).qG] P.xw#=^`|)Z@9YIYү ĪRxrLO>ڳ\CNW=u3L՞eÅx[QSRvW#Kemn< X֎/Zĕ`U@L ?dQ2 Ha pH @$MPjUDlYB g| URtA幂-h^LoHQK#BAX8rcCPGRC3)4QExu>8zعtXZkOS-mCԄ8=;.4@vΧGIm8CY:yz|=#el/-vncVԎOK/1VGFh?Fpo3Jh׬ߕ9 .Z J%2 b4(c&1?l&udmռ,6qnv0~őhζ|i[[Tp|uDxZJn]v8+ hwaY#P2Fc@7 Y>7ިWG p&*jvf>ūg1|Zy@HXcYl ܎u>|-mч l %1L8`+Rvkodh[۶&V$D1 0@TU@!'[yv{]imFYyto /Y%[Agl6wOo:RwQtovKlǘ#Nu3d|4 ⣩ITOY+rN5,$Qn:Yy/h`Sx[MUkb\~k7쁖xAkgn44R`V^r:Xm~CFJCBFMQjVi@巛x9͊OQo19\_M,80AcJ iB"θ "0 C2.06qOޡ.Ie?5gmFGhRh*h)J6o2\Ur.慤:WZtꕫ: c,'GT)X6\1|r8>7_^P鬡.>/.R%{H;7ISYaȣ<_ugv˘ @$Чjȫh5P00l8]x˦}vT5Ԟ6cWHSYM{,0kW^Z)Z6UbP00#\265hTNcEr{7^=GBEuޗg?8Y=耑1s{Ҁ1s{Ҁ/s{!ϺQDEuވ *Q*N+-76?SZ+BX}ȽNiKB}ȽNiC0NNi(GEp1ףT\3454Tj[Wr\CIc)Bv[Z'n5rbޮHIfg!ϺQDW>=GY=A))CFýI]hFS\1F\sgf26Ya g^! ַ%v+ 3w>=Gi3W>=G8f}zz $wn}zz $N\9pQM8bIʰh޳+u$m4Q1f\i_;nuޅW\`8حR9٬gi5|QM:u!tV0os{jt.}zzpFFϺQD 1s{ӁH>qs{RDW<.7W"Vv^ #k<7y cq۷q\mA~'_C~\^y,qAGhuZzYPLv|ͲQL8Z#m/q{Lx{7ވ s3{#'κ?26e%VNwD/R 7dnQ2~KίKIWW9{-[r?QZ}4g>kyGwz^Q~~wB~kwG=z?5#zh=C[f2 /h;toZw;[HuzM͙^Q0ZcZ܅iQpsb3W%GS݅uޚB|g"׺QNAuގ"|g$9Y=HFfg#bgB3>=G(uޗgAuވ>=G/\$_7Y=@7Y=Hos{"ϺQJG ϺQD>=G8 .}zz r\@Hfg#Nfg9Y=耐|g|gEuވ n}zz $_9Y=ɖ@)@&0xH (}W]uD,Bg\UFp<)lmarlYh?21*%tY~У:q-obU*a2 I[Qb>'G39w+ ,?,#wRѐa๊c͏]j=;~ܟr&00 pr$1HGBPU6y~PHxer}C 7=\e-%fA+kvN=Ҳ}/?j.):O:"P)JbJbĈ(=ГC4ds[펖#⎷KV{|.cNi ˪ίoz~fgv>cFH| = ⴞ{-a$Z Gy;#}KXx6`*JE"9/"v])Ҧ|#q{8Ԯh]#6JB|?R"n[u"I!iQhQT%J8JYtGK.Q.6~O~//W࿹zrSx0nԅ ԾosAB`  1U*!U$!H U@ H*U@""H)1 pH$Z4@K3U=(JP~RC@j/@j Zoߗ)?)]to߷N[㞋ґ!lj0*#`<  $ @ HZ H@ 1T5L jbiococoa-2.2.2/Documentation/images/BioCocoaDoc.jpg000755 000765 000024 00000022327 11065776416 022647 0ustar00scottcstaff000000 000000 JFIFddDucky<Adobed       @  !1A"Qaq2B#Rbr3ᒢCSc$T%4tUu67 !1AQ"2aqB ?xVxuw;xO?U.ZiW&y{q+eq5>v_c^혥4f&L\;V:Gkˬ3JU!:KV On~ p1yүIx}^}i1GxD!~wOƸd2-icgP:'wp˚C4.o4%s8{ĚԯUqkhZ+yv=)q|۠:N 6L<;[5j#C!;]}m9ǽfŇ/=Sgdznupmbui^~Lټ4[|N͉qX@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Aw}wmbe5x:/>N<^%}W2妐gڑ@%z,}to.\#c Wt‘5SD\! q Zu$kqQS_ޠS|aBOS-e7ThZJ Ji5ҾK%@:NIC>x6s?}w46HG1F@PӮ|nh|cV6Ee3 p%үރ{mn{FWKI^ZDoܞ+6vN 6<r־d9vۺI=y =jɞ!s=;1}\ftLpC__0?YJ'@n*P4-5 @:zlPCJ}q` ;JJFj4<a%_)ì,0?5߈G.g+w]c1hkZƊ /jA? WA>i{w2Y~}A{} igSLFX2uַq1&|a\H5 i &jIsyG0y,ft0>x/8T_Hd˛"(4VFB pTp:2=F"8TTx".jh}&%i.wSҨA ݪv˷72^q5i縍G*|r?{o_'Gr~OdlvmntRlr\3Hb3~O<9-`0NMQti)luI '9\'q668a{Z֊I4 #Ĺ !<K/S~*FV'BBn<;[0('f-LzQk]Oj g5VbHoacĆݲ|a,/p@i k@{ϲ9 W,'?Fh_;luC nQ,o.8KtQ_}9' ppHhpgG o"1V8?mwze%{B^#?OV9U0ve7w.\wHF=o%\ :ST{>Yس]m.g^T u<\OPK|˖vo`/"<}a( -:vC}Kqm乊 /1Qnn MEEK^?z\;ݚ4pZne#!'.htpb;{ۻku  }v:k{vjYw[n1q-;if /kXiG1A-'p-Y~Ae~f2Y`i}I.XZHZ43"]F蟶\6c ]^}fKK{LrTJ<$q$pdl{RI>9瓑\rc^߰hcD3?7žٗ.Z"]C h=^K5^6x5"{7R hjIo {I$ SE)媬Ey$5­ƢS` E?b _z/+ycMl\etP\9mg~)tC@q4Uqi|I^.ti6Y{Y3c:'Y4M,ԍf8%kE4\fswW72eq{9qWrn٠4@bqZkh4qqKt6D6,t_+DgvpiҢV!)=S4= )©QIFk\4@t(9 j2qGHP IAO."H Hi=*epXc/k@ٲc?hѩU˒-o/xY6 :/4ۉJ5/˖VwmaKu}ܬBX~9⎐܎){˪&~1a` ,@ 0~&?hһ<6 l|\vI@ |nGX;o6p~Ph357lW;熀Ii&AZ22A,h4D5k܏ W+o3tlp'Asa̜6_cswCqvh5uAqq̱P$mdIi髉/n31Ⱦ`md@˔Xc\BMҳ֏hsX*KH%6:LDV>'<%A_.>2oPCx7DCA P0| d޴o`C5}zWk'cmþ'[jɀi]t$SDovˇ[m7M&bf)}C>6ii]~>c>:-[4HZ޻@%3ɯo%c_ mdt hk :;}עHzuw K;;Iq>vՅC_ n{;[\]X1stO)l1Ӳ{͂}=@Xۻ+kq I k< XѧƿJ{澃{uNŮphHno/{+Eaƺݵ $`Kd[PWUoF||(V2ği*GbPy0)zjDiAA$Pj)k.m_{xɀoc =@:4jUn-D-I!ێg1G$g52_|==Wry3&ܬ(PrQh4YTV}Rg䖸ݞ@rY grmb|ocis+@A AO:0LC$X3ym7nۥ+YK-i&٣߿R7XIni۶NE.F?iq6scqHV(W~gc-s41ijtA}ugty՝`yl$>pӰ R!_K,1>]FC+҄B%t6G9'`$6AUN\usxk3`ĄL{2#pwC&-!5@P(u7)}i=SW;ٯ%եwJnGFCJ3Ko#,A{E*[^I%^k{ѝ<Ҿ(+d"reͬVL-ޟB>q:H{̷sH&ztJcYMțwuJAXcXZsH4T\ {cx3!b+y-Yv3L2trFG|mpP:[싢m K~ݘUrڱ_(=wˣ4Fiҧ<_F9h$N3LSnCD̳wnbrRkvHlzeäMm?e2aFrN<&B]X4Y5h9{oe}7vXqmalm 4o7p+ҝfx|bvhUhٳ?Kʲ?3&ޟ$@hfxcW(<ߤ~!pNkhhLe1 [@)CPjYgx~X 9ocdRKK&:Kiƫdғ+e/<6nnѠ=X >mOrSrvͷ؋ vN.3Oy6.;  _5՛#%.kDr;5>4Z츴L߾=9FBźk=4=&Ǔuư!kS5Н`EҌÍ7\_0ZAK qWK m}c!yA8s*on"(m TJAguvTw!6W&8AA ;WL{QOGtXDV5lzr8is{_]5϶yu5uu7tae-#;%x湺,7[IDȻiV[2")a_zt;)~+/5k\KyK+fM|~>1tȘ-\D 4 About CVS

About CVS

This document explains how to use the Concurrent Versions System (CVS) with the BioCocoa project. To be able to use CVS and contribute code to the BioCocoa project, you will need to have an account at bioinformatics.org, and request to be added to the developer list by the project leader, Peter Schols. You can get more information about the use of CVS with bioinformatics.org projects here.



Getting the BioCocoa project on your computer

To upload/export the BioCocoa project into your computer, open Terminal.app on your machine and make sure that you are using the bash shell by typing bash at the prompt. Now you can excecute the following commands:

  • First, set these two shell parameters:

    export CVS_RSH='ssh'
    export CVSROOT=':ext:loginname@bioinformatics.org:/cvsroot'

    (make sure to replace loginname by your login)

  • Create a folder on your machine where you want to store the BioCocoa source, e.g.

    mkdir ~/Desktop/BioCocoa
  • Move to that folder, e.g.

    cd ~/Desktop/BioCocoa
  • Move the contents of the CVS repository to that folder:

    cvs checkout BioCocoa -P

The entire BioCocoa project will be now be transfered to your local folder. You can monitor what's going on in the Terminal window.


Setting up ssh keys

To be able to use CVS transparently in GUI applications, in particular Xcode and CVL, you will need to set up ssh on your machine and on your account at bioinformatics.org, so that you don't need to type your account password everytime you want to use CVS. After setting this up, you will never be asked for your bioinformatics password anymore. This is how GUI applications can run without having to deal with passwords. One other advantage of doing this is that your scripts will be able to run without human intervention. The disadvantage is that anyone who can access your account on your local Mac OS X box will also be able to access those remote servers which have stored your public key.

Create public/private key pair with the ssh-keygen command

Open Terminal.app on your machine and type the following commands at the prompt:

  • ssh-keygen -t dsa

    The ssh-keygen process will generate a key pair

  • Enter file in which to save the key:
    You can choose the proposed file name and path
  • Enter passphrase (empty for no passphrase):
    Just hit return when you are asked for a passphrase
  • Enter same passphrase again:

    Hit return a second time.

  • You will see the following output:
    Your identification has been saved in /Users/yourlogin/.ssh/id_dsa.
    Your public key has been saved in /Users/yourlogin/.ssh/id_dsa.pub.
    The key fingerprint is:
    followed by the key that is generated for your local account.

Note that you could choose to type a password, it does not have to be the same as your bioinformatics.org password. However, if you type a password, it will be needed to access your ssh account. This can makes things more complicated, in particular with CVL. You can always change that password or remove it (by replacing it with an empty password), using the command ssh-keygen -p.

Place your public key on the remote host

Once you have created your private and public keys, you need to place your public key on the remote host in a place where ssh and scp can recognize it. For this, add the contents of your local ~/.ssh/id_dsa.pub file to the file called authorized_keys in the ~/.ssh directory in your remote account at bioinformatics.org (if you don't have such file already, you can create it). You can do this by SFTP'ing to your bioinformatics.org account and by creating a .ssh folder in your Home directory and by adding a authorized_keys file to this dir.

Another option is to use the Terminal (I have not tested that):

  • ssh loginname@bioinformatics.org

    (make sure to replace loginname with your bioinformatics login)

  • Type your password
  • cd .ssh
  • echo '--...copy paste the line from you local ~/.ssh/id_dsa.pub file...--' >> authorized_keys

    (the line you have to copy is very long, make sure it is all on one line)

  • exit

If you are going to access the CVS from different machines, you will have to add one line per machine, so make sure you are on a new line when adding another key to the authorized_keys file.


Using SVN in Xcode

Add a section on using Subversion here

Using CVS in Xcode

To be able to use CVS in Xcode, you need to set up a pair of private/public key on your machine and on your account at bioinformatics.org, as described above. Xcode will then be able to connect to the CVS server without asking a password. You can use the built-in SCM support to work on the project and use CVS in Xcode.

To start using CVS in Xcode, double-click the project icon at the top of the 'Groups and Files' view. In the 'General' tab, check the box 'enable SCM' and choose CVS. Click on the edit button to specify to use ssh.

Look into the SCM smart group on the 'Groups and Files' panel on the left. New files and modified files will appear in this group, as indicated by a letter on the left, 'U' for updated (you have an old version), 'M' for modified (you have modified it and may need to commit), 'A' for new files (need to be added first), 'R' for removal, 'C' for conflict,...

The files for the project itself are in the file package 'BioCocoa.pbproj', which contains 'project.pbxproj' and one file per user, e.g. 'username.pbxuser'. The first file is modified every time the project is modified (adding files, changing target settings,...), the second when a user changes her settings. These files will only appear in the 'SCM' smart group, and should be committed to save changes to the project, or the other developers won't have access to the changes.

Things you can NOT do in Xcode, and for which you will have to use another tool (command line or CVL):

  • add new folders
  • manipulate files that are not referenced in the project
  • update new folders created by others
  • add new folders

Using CVL to perform CVS operations

As an alternative to Xcode, there are other GUI tools available, including CVL, that you can download from here. The following instructions have been tested with version 3.4.7 (b72).

CVL has instructions to use a remote repository like bioinformatics.org. Here are these instructions:

  • Install the private/public keys as described above, so that CVL can ssh into the repository without a password. The setup is much easier if you did not set a password on the private key. If you did and want to use it, look into CVL help.
  • In the Repositories window, click on button Add..., choose the Other repository type, and type the following in the Repository root field:
    :ext:username@bioinformatics.org:/cvsroot

    (replace username with... your user name). After clicking OK, CVL will try to connect immediately, and fail, as we haven't finished configuring it. Don't worry.

  • In the Repositories Window, tab Environment, click on Add to add key CVS_RSH with value /usr/bin/ssh.
  • If you have already checked out the code, you can open the project using the menu Work Area...Open, and select the BioCocoa folder.
  • Otherwise, in the Repositories Window, click on Checkout, type 'BioCocoa' in the Module field, and choose a location to checkout the project.

Here are the most important items that you will probably use in the menus:

  • Work Area...Refresh : refresh the display and the icons on the files; to use every time you made changes to the project, or before working on it to check what other developers may have done.
  • Work Area...Commit Files : commit all the changes.
  • Work Area...Update Files : update all the files in the whole project to match the most recent version.
  • File...Commit : commit only the selected files.
  • File...Mark File for addition : to add a file to the repository (you need to commit then).
  • File...Mark File for removal : to remove a file from the repository (you need to commit then).

Switch off SCM in Xcode if you want to use CVL. Remember to always close your project in Xcode when you update the project file package itself, as Xcode might otherwise get very confused. Never delete a file in Xcode. Only remove the reference. Then you can mark files for removal and commit using CVL.


Moving files and folders

This is quite complicated with CVS. Read a CVS manual before doing it if you are not familiar with CVS.


Using the command-line for CVS

This is not an attempt to write a tutorial for the use of CVS, the reader is referred to the many excellent tutorials that already exist, most of them freely available through the web. And of course 'man cvs' is your friend. However, there are a few useful tips that are listed below. These instructions assume that the user is familiar with the command line.

  • Use the -P and -d flags for the 'cvs update' command:
    cvs update -P -d

    The -P flag wil prune (remove them from the working copy) empty folders, the -d flag makes sure that new directories added by someone else will also be added to your local repository.

  • When updating resources in a nib file, you have to realize that a nib-file is actually also a folder. So for instance to update the MainMenu.nib file, you would:
    cd MainMenu.nib

    In this folder you will find at least three files: info.nib, classes.nib, and keyedobjects.nib. The first two are regular text files, and can be treated by CVS as source code files. However, the keyedobjects.nib file is a binary file, and need some special attention. To update the changes you will need to issue two commands:

    cvs update -kb keyedobjects.nib
    cvs commit -m "added cool new feature" keyedobjects.nib

  • Part of the contents of this page was originally in Peter Schols' message on the BioCocoa-dev mailinglist.
  • A good CVS tutorial can be found here.
  • A complete book on CVS has been published online here.

Back to index

biococoa-2.2.2/DeveloperDocs/about-svn.html000644 000765 000024 00000031357 10414622521 021305 0ustar00scottcstaff000000 000000 About Subversion

About Subversion

This document explains how to use Subversion (SVN) with the BioCocoa project. To be able to use SVN and contribute code to the BioCocoa project, you will need to have an account at bioinformatics.org, and request to be added to the developer list by the project leader, Peter Schols. You can get more information about the use of SVN with bioinformatics.org projects here.



Getting the BioCocoa project on your computer

To upload/export the BioCocoa project into your computer, open Terminal.app on your machine and make sure that you are using the bash shell by typing bash at the prompt. Now you can excecute the following commands:

  • First, set these two shell parameters:

    export CVS_RSH='ssh'
    export CVSROOT=':ext:loginname@bioinformatics.org:/cvsroot'

    (make sure to replace loginname by your login)

  • Create a folder on your machine where you want to store the BioCocoa source, e.g.

    mkdir ~/Desktop/BioCocoa
  • Move to that folder, e.g.

    cd ~/Desktop/BioCocoa
  • Move the contents of the CVS repository to that folder:

    cvs checkout BioCocoa -P

The entire BioCocoa project will be now be transfered to your local folder. You can monitor what's going on in the Terminal window.


Setting up ssh keys

To be able to use CVS transparently in GUI applications, in particular Xcode and CVL, you will need to set up ssh on your machine and on your account at bioinformatics.org, so that you don't need to type your account password everytime you want to use CVS. After setting this up, you will never be asked for your bioinformatics password anymore. This is how GUI applications can run without having to deal with passwords. One other advantage of doing this is that your scripts will be able to run without human intervention. The disadvantage is that anyone who can access your account on your local Mac OS X box will also be able to access those remote servers which have stored your public key.

Create public/private key pair with the ssh-keygen command

Open Terminal.app on your machine and type the following commands at the prompt:

  • ssh-keygen -t dsa

    The ssh-keygen process will generate a key pair

  • Enter file in which to save the key:
    You can choose the proposed file name and path
  • Enter passphrase (empty for no passphrase):
    Just hit return when you are asked for a passphrase
  • Enter same passphrase again:

    Hit return a second time.

  • You will see the following output:
    Your identification has been saved in /Users/yourlogin/.ssh/id_dsa.
    Your public key has been saved in /Users/yourlogin/.ssh/id_dsa.pub.
    The key fingerprint is:
    followed by the key that is generated for your local account.

Note that you could choose to type a password, it does not have to be the same as your bioinformatics.org password. However, if you type a password, it will be needed to access your ssh account. This can makes things more complicated, in particular with CVL. You can always change that password or remove it (by replacing it with an empty password), using the command ssh-keygen -p.

Place your public key on the remote host

Once you have created your private and public keys, you need to place your public key on the remote host in a place where ssh and scp can recognize it. For this, add the contents of your local ~/.ssh/id_dsa.pub file to the file called authorized_keys in the ~/.ssh directory in your remote account at bioinformatics.org (if you don't have such file already, you can create it). You can do this by SFTP'ing to your bioinformatics.org account and by creating a .ssh folder in your Home directory and by adding a authorized_keys file to this dir.

Another option is to use the Terminal (I have not tested that):

  • ssh loginname@bioinformatics.org

    (make sure to replace loginname with your bioinformatics login)

  • Type your password
  • cd .ssh
  • echo '--...copy paste the line from you local ~/.ssh/id_dsa.pub file...--' >> authorized_keys

    (the line you have to copy is very long, make sure it is all on one line)

  • exit

If you are going to access the CVS from different machines, you will have to add one line per machine, so make sure you are on a new line when adding another key to the authorized_keys file.


Using SVN in Xcode

Add a section on using Subversion here

Using CVS in Xcode

To be able to use CVS in Xcode, you need to set up a pair of private/public key on your machine and on your account at bioinformatics.org, as described above. Xcode will then be able to connect to the CVS server without asking a password. You can use the built-in SCM support to work on the project and use CVS in Xcode.

To start using CVS in Xcode, double-click the project icon at the top of the 'Groups and Files' view. In the 'General' tab, check the box 'enable SCM' and choose CVS. Click on the edit button to specify to use ssh.

Look into the SCM smart group on the 'Groups and Files' panel on the left. New files and modified files will appear in this group, as indicated by a letter on the left, 'U' for updated (you have an old version), 'M' for modified (you have modified it and may need to commit), 'A' for new files (need to be added first), 'R' for removal, 'C' for conflict,...

The files for the project itself are in the file package 'BioCocoa.pbproj', which contains 'project.pbxproj' and one file per user, e.g. 'username.pbxuser'. The first file is modified every time the project is modified (adding files, changing target settings,...), the second when a user changes her settings. These files will only appear in the 'SCM' smart group, and should be committed to save changes to the project, or the other developers won't have access to the changes.

Things you can NOT do in Xcode, and for which you will have to use another tool (command line or CVL):

  • add new folders
  • manipulate files that are not referenced in the project
  • update new folders created by others
  • add new folders

Using CVL to perform CVS operations

As an alternative to Xcode, there are other GUI tools available, including CVL, that you can download from here. The following instructions have been tested with version 3.4.7 (b72).

CVL has instructions to use a remote repository like bioinformatics.org. Here are these instructions:

  • Install the private/public keys as described above, so that CVL can ssh into the repository without a password. The setup is much easier if you did not set a password on the private key. If you did and want to use it, look into CVL help.
  • In the Repositories window, click on button Add..., choose the Other repository type, and type the following in the Repository root field:
    :ext:username@bioinformatics.org:/cvsroot

    (replace username with... your user name). After clicking OK, CVL will try to connect immediately, and fail, as we haven't finished configuring it. Don't worry.

  • In the Repositories Window, tab Environment, click on Add to add key CVS_RSH with value /usr/bin/ssh.
  • If you have already checked out the code, you can open the project using the menu Work Area...Open, and select the BioCocoa folder.
  • Otherwise, in the Repositories Window, click on Checkout, type 'BioCocoa' in the Module field, and choose a location to checkout the project.

Here are the most important items that you will probably use in the menus:

  • Work Area...Refresh : refresh the display and the icons on the files; to use every time you made changes to the project, or before working on it to check what other developers may have done.
  • Work Area...Commit Files : commit all the changes.
  • Work Area...Update Files : update all the files in the whole project to match the most recent version.
  • File...Commit : commit only the selected files.
  • File...Mark File for addition : to add a file to the repository (you need to commit then).
  • File...Mark File for removal : to remove a file from the repository (you need to commit then).

Switch off SCM in Xcode if you want to use CVL. Remember to always close your project in Xcode when you update the project file package itself, as Xcode might otherwise get very confused. Never delete a file in Xcode. Only remove the reference. Then you can mark files for removal and commit using CVL.


Moving files and folders

This is quite complicated with CVS. Read a CVS manual before doing it if you are not familiar with CVS.


Using the command-line for CVS

This is not an attempt to write a tutorial for the use of CVS, the reader is referred to the many excellent tutorials that already exist, most of them freely available through the web. And of course 'man cvs' is your friend. However, there are a few useful tips that are listed below. These instructions assume that the user is familiar with the command line.

  • Use the -P and -d flags for the 'cvs update' command:
    cvs update -P -d

    The -P flag wil prune (remove them from the working copy) empty folders, the -d flag makes sure that new directories added by someone else will also be added to your local repository.

  • When updating resources in a nib file, you have to realize that a nib-file is actually also a folder. So for instance to update the MainMenu.nib file, you would:
    cd MainMenu.nib

    In this folder you will find at least three files: info.nib, classes.nib, and keyedobjects.nib. The first two are regular text files, and can be treated by CVS as source code files. However, the keyedobjects.nib file is a binary file, and need some special attention. To update the changes you will need to issue two commands:

    cvs update -kb keyedobjects.nib
    cvs commit -m "added cool new feature" keyedobjects.nib

  • Part of the contents of this page was originally in Peter Schols' message on the BioCocoa-dev mailinglist.
  • A good CVS tutorial can be found here.
  • A complete book on CVS has been published online here.

Back to index

biococoa-2.2.2/DeveloperDocs/about-tests.html000644 000765 000024 00000015713 10404057133 021637 0ustar00scottcstaff000000 000000 Using Tests

Using Tests


Note for Tiger users:

The OCUnit testing framework is now included with the DeveloperTools (starting with Xcode 2.1), so there is no more need to install the framework.


Installing the SenTestingKit framework

To be able to compile and run the existing tests written for the BioCocoa project, you will first need to install the SenTestingKit framework, a.k.a. OCUnit.

Download the latest version from the Sente web site. Currently there are two versions of the installer, one to install in your home directory, one to install at the root level. Because of path issues, the BioCocoa Xcode project expects the OCUnit framework and the accomanying tools to be installed at the root level. So be sure to download the right installer. For all tests to work, make sure you download v40 or higher.

Files will be installed in these locations, so it is easy to remove if not needed anymore:

  • /Developer/Examples/
  • /Developer/Tools/
  • /Developer/Source/
  • /Library/Application Support/Apple/Developer Tools/File Templates/
  • /Library/Application Support/Apple/Developer Tools/Project Templates/
  • /Library/Application Support/Apple/Developer Tools/Target Templates/
  • /Library/Frameworks/
  • /usr/local/man/man1/

Adding test classes to an existing Test target

As of May 2005, there is only one 'Test' target in the BioCocoa project, the 'Test-BCFoundation' target. Because the BCFoundation is the only framework to date, there is so far no need to add a new 'Test' target. But read the next section on how to add a target when that becomes necessary.

On the existing target (s), more tests are always welcome. To add more tests, you can either add more methods to an existing test class (a.k.a. 'test case'), or create a new class. The difference is quite subjective. A test class is supposed to group together methods that all deal with one of the BioCocoa class to be tested, or to deal with one aspect of it. For instance, the test class 'TestBCSequenceDNAInit' tests the initializers of the class BCSequenceDNA, using various parameters for the 'initWithString:' methods. Alternatively, and according to the 'test units' terminology, a class can be a 'test case', a test of a real life example. For the BioCocoa framework, a 'test case' could be a sequence file loaded from disk, and a series of tests would be performed to check that it loads and behaves properly. The bottom line is: there is no rules on how to decide when to start a new test class, it depends on what you test. Also, it is NOT critical to have clean code, or well-commented code. Typical test methods are short and self-explanatory. As long as they don't fail, nobody has to read the code. The day a test start failing because of some changes in the code in the BioCocoa code, it should be fairly easy to find the problem (it could be the test itself that does not make sense anymore!).

Practically, a test is a method with a name starting with 'test', is 5-20 lines of code and includes a 'STAssert...' statement that will fail if the behavior differs from what is expected from the BioCocoa framework. As explained above, the test methods are grouped in classes. One class will typically implement 5-50 test methods. If you create a new test class, make sure you add it to the target of interest, e.g. 'Test-BCFoundation'. Also, a test class should always be a subclass of SenTestCase and should #import the SenTestingKit header. Read the code of existing tests to have examples of test classes and class methods, and read the OCUnit documentation (link to your local documentation, only accessible after installation) to get a complete list of the macros used for assertions.

Remember to put any new file (.h and .m class files) in the right location, inside the group 'Tests/Test-BCFoundation' in the Xcode project, and in the right place in the project folder as well, 'BioCocoa/Tests/Test-BCFoundation'. By default, Xcode will not put new files in the right place on the filesystem, so check everything before you commit new files.

Compiling and running tests

To compile the test framework, be sure to select the test target, e.g. 'Test-BCFoundation'. After you hit the 'Build' button, Xcode will compile a bundle named 'Test-BCFoundation.framework', and after compilation, will run a one-line shell script '/Developer/Tools/RunTargetUnitTests'. This tool will scan the test framework, go through all the classes, and automatically run all the methods that start with 'test...' in their names. Thus, the tests themselves are run as part of the build, after the compilation. If a test fails, it will show as a build error in the build window, and the corresponding line will link to the faulty code in the test method.

As an alternative, after the build, the tests can also be run using the 'Run' button, which will start the executable '/Developer/Tools/otest' with the appropriate arguments. The tests are executed exactly the same way as above, but the result will now be displayed in the 'Run' window, with a log of the failed tests and the successful tests, with no link to go to the code, like you found on the build window. However, you will also have information about the timing, the total number of tests, any message included in the tests, ...

Creating a new Test target

A new 'Test' target should only be created if a new framework is ever added to the BioCocoa project, other than BCFoundation (probably BCAppKit one day...). When this becomes necessary, create a new framework target. Change the build settings based on the Test-BCFoundation target. Add an executable '/Developer/Tools/otest' and set it as the executable for the new test framework. Set the arguments of this executable taking as example the 'otest for Test-BCFoundation' executable. Finally, add a shell script phase at the end of the build of the new test target, which should be set to simply use '/bin/sh' as the shell and run the one-liner '/Developer/Tools/RunTargetUnitTests'.

It is also probably a good idea to read the OCUnit documentation to fully understand the details of the whole process.

Back to index

biococoa-2.2.2/DeveloperDocs/bc.css000755 000765 000024 00000000641 10404057133 017572 0ustar00scottcstaff000000 000000 body { color: black; background-color: white; font-family: verdana, sans-serif; text-align: justify; line-height: 1.8em; margin: 2.5em; font-size: 1.0em; } h2 { font-size: 1.5em; } h3 { font-size: 1.2em; } h4 { font-size: 1.0em; } pre { font-family: courier, courier new, monospace; padding: 5px; margin-left: 20px; border: 1px solid lightgray; } biococoa-2.2.2/DeveloperDocs/biococoaxcode.html000644 000765 000024 00000002201 10404057133 022152 0ustar00scottcstaff000000 000000 BioCocoa and Xcode

Compiling BioCocoa in Xcode

This section is probably NOT useful for anyone who succeeded in compiling the latest BioCocoa version from our CVS server. However, for people new to the project, this might be of interest. If you experience problems when compiling the latest version of BioCocoa, make sure you install the Mac OS 10.2.x and Mac OS 10.3.x SDKs from the Xcode CD. I don't think these SDKs are installed by default. However, they are required to properly compile BioCocoa. After installing them, make sure that BioCocoa links to the right SDK in the Xcode project:

  • Select the BioCocoa target from the list of targets
  • Click Get Info and then select the build tab
  • Make sure the SDKROOT property points to a valid SDK path

That should fix any (pre)compiler errors.

Back to index

biococoa-2.2.2/DeveloperDocs/headerdoc.html000755 000765 000024 00000004275 10404057133 021307 0ustar00scottcstaff000000 000000 Using HeaderDoc

Using HeaderDoc

The BioCocoa Project uses Apple's HeaderDoc tools to an HTML based API documentation from comments embedded in the source code. To transform the HeaderDoc information into a html format, the BioCocoa Xcode project provides a script that will automatically generate the html docs. To activate the script, open the BioCocoa target in the left panel in Xcode, and select 'Shell Script Files'. Then click the Info button (Command-I), and unselect the 'Run script only during deployment builds'. Now rebuild the framework, and a new directory will be generated in the BioCocoa directory on your local harddisk. Note that for now the documentation will not be added to the Xcode project.

Alternatively, you can generate the html pages from the command line. The advantage of running these commands from the command line is that you can see from the output in the terminal if there are any errors in the HeaderDoc entries. First cd into the root level of the BioCocoa project on your HD. Then issue the following commands:

mkdir -p Documentation
headerdoc2html -o Documentation BCFoundation
headerdoc2html -o Documentation BCAppKit
gatherheaderdoc Documentation
The gatherheaderdoc command will fail if there is a space in the path to the BioCocoa directory. You can read the generated html by opening the file MasterTOC.html in the Documentation folder.

For more information on the use of HeaderDoc, type man headerdoc2html or man gatherheaderdoc. Another good source is the Apple documentation. An alternative to HeaderDoc that we could look into is Doxygen.

Back to index

biococoa-2.2.2/DeveloperDocs/index.html000644 000765 000024 00000005255 10404057133 020474 0ustar00scottcstaff000000 000000 BioCocoa Developer Documentation

BioCocoa Developer Documentation

This page is meant to provide an index for the different documents that a developer new to BioCocoa may want to read. Anybody is welcome to edit this page. The html format was chosen to allow for links. To switch between editing and display of this page from Xcode, use the contextual menu on the file in the groups view, and choose the Open As... or Open with Finder menu item.

To add contents to the developer documentation, create a new file in the directory 'Developer-documentation' in the project folder. Do NOT add the file to any target (otherwise it will end up in the framework bundle resources). This new file can be in any format easily readable within Xcode (plain text, html, rtf). After adding the file, add a link to the newly created page on this index page. Note that the link will open in a new window, except if the format is also html. So maybe you want to use the html extension even for plain text, and even if you don't use any html tag.

Important. The "BioCocoa Developer Documentation" is not aimed at the users of the framework. The documentation provided to the user is generated with HeaderDoc and should be included in the headers. Similarly, the "BioCocoa Developer Documentation" should not replace comments in the implementation of the different classes, where you should still explain the purpose of the class and its design. Ideally, the "BioCocoa Developer Documentation" should thus only cover topics not directly related to the code (e.g. cvs setup), or topics of broad interest (design choices, relationship between parts of the frameworks, general organization of classes...).

Index

biococoa-2.2.2/DeveloperDocs/newfiles.html000755 000765 000024 00000005114 10404057133 021176 0ustar00scottcstaff000000 000000 Adding new files

Adding new files to the framework

Please follow these steps when adding new files to BioCocoa. This will make sure that whatever you add will be visible and usable in the Xcode project of the other developers, and minimize the Xcode-cvs issues that some of us are experiencing.

  1. Add the files in the right location in Xcode, so they match the structure on your HD.
  2. Add the new files to BCFoundation.h or BCAppKit.h under their appropriate header, reflecting the project's file structure.
  3. Click on the BioCocoa target and make sure all headerfiles are labeled 'public' (except for BioCocoa_Prefix.h).
  4. Header files in BCFoundation only need to add #import <Foundation/Foundation.h> and not #import <Cocoa/Cocoa.h>. Header files in BCAppKit need #import <AppKit/AppKit.h> and maybe #import <Foundation/Foundation.h>.
  5. In public headers, check that you do not use relative paths in your #import statements. Example: use #import "BCSequence.h" and not #import "../BCSequence/BCSequence.h" if called from a file in another folder. The compiler will find the header even without the correct path.
  6. Change "_MyCompanyName_" to "The BioCocoa Project".
  7. Make sure the target compiles without errors and warnings.
  8. Add and commit the files to the cvs repository, and don't forget to commit the changes to BCFoundation.h and project.pbxproj. You should be able to use cvs from within Xcode (see also the Xcode cvs setup documentation). However, using cvs from the command line has proven more reliable, at least in my hands ;-). If you use Xcode, never select BioCocoa at the top of the "Groups & Files" and then commit changes to cvs, this will wreak havoc. Always commit individual files. The best place to do this is within the SCM disclosure triangle in the "Groups & Files" pane. This is also the only place where you can commit changes in project.pbxproj from Xcode. If you use the command line, you will find project.pbxproj inside the BioCocoa.pbproj folder at the root level of the framework.

That should be it!

Back to index

biococoa-2.2.2/DeveloperDocs/newtargets.html000755 000765 000024 00000006615 10404057133 021554 0ustar00scottcstaff000000 000000 Adding new targets

Adding new targets to the framework

Please follow these steps when adding new targets to BioCocoa. This will make sure that whatever target you add will be visible and usable in the Xcode project of the other developers, and minimize the Xcode-cvs issues that some of us are experiencing.

  1. Add a new target by right-clicking the Targets icon and select Add -> New Target. Select the type of target you want to create. Note that we try to reflect the file hierarchy with the targets and project settings. For instance, all examples are found in a folder "Examples" in a folder with the name of the target, e.g. "Translation".
  2. Select the new target, right-click it and call up the info panel.
  3. Rename the target according to the simple guideline: TYPE_OF_TARGET - YOUR_TARGET_NAME, for example: "Demo - Translation" or "Test - BCFoundation". Try to re-use existing target types wherever possible.
  4. In the same info panel, under the "General" tab, add the BioCocoa.framework target to the "Direct Dependency" list using the little plus button in the lower left corner. This ensures that whenever changes are made to the main framework, that framework is first compiled before your target app will be.
  5. Next, move to the "Properties" tab of the info panel. Name your build product, and fill in the identifier using the following convention: org.bioinformatics.biococoa.YOUR_PRODUCT_NAME. Of course you're free to add more relevant info for your product, like a custom icon.
  6. Now move to the "Build" tab of the info panel. You need to fill in or adjust a few parameters here depending on the type of target you create. Please scroll through the list and check if all links are reflecting the file hierarchy of your project. In other words, all paths should be relative to the project's root. For example, if the info.plist of your target is inside the folder Examples -> Peptides, change the "Info.plist File" parameter to: "Examples/Peptides/Info-Demo-Peptides.plist" The same holds true for the prefix_header file.
  7. Adjust in the build parameters list the "Mac OS X Deployment Target" parameter to reflect the minimum version of MacOSX your product should run on.
  8. Finally, drag your new target at the right place in the list of targets, that is grouped by target type, on alphabet.
  9. Don't forget to add the BioCocoa framework to your app if needed, open your target (using the little triangle) and drag the BioCocoa.framework from the Products folder to the "Frameworks & Libraries" build phase. Also if you want your application to run stand-alone, add a "copy files" build phase to your target using the Project -> New Build Phase -> New Copy Files Build Phase menu item, and add the BioCocoa.framework there as well.

That should be it! You can now add new files to the target and build your product. Of course, don't forget to commit your changes to the CVS repository.

Back to index

biococoa-2.2.2/DeveloperDocs/todo.html000644 000765 000024 00000005127 10660130573 020334 0ustar00scottcstaff000000 000000 TODO

TODO list for The BioCocoa Project


General:

  • Look for more places to use NSData in more places to replace the symbolArray
  • Implementation of a mutable sequence class
  • Update the documentation and headerdoc entries to reflect the new BCSequence/NSData structure
  • Update the test code to reflect the new BCSequence/NSData structure

Koen's list:

  • help with BCFeature and BCAnnotation classes
  • Work more on BCSequenceReader and BCSequenceWriter classes
  • Start working on BCScanner and BCDigest class
  • Add more headerdoc entries
  • Add specialized views (low priority)
  • Set up the initial wiki page

Charles' agenda = what I want to do in order of priority:

  • add dev-doc to explain BCSequence et al. design
  • implement tests for symbol sets --> idea: systematically use the whole alphabet - BTW, need X for proteins??
  • implement tests for translation
  • get the sequence IO to a point equivalent to the current BioCocoa release (well, first, understand how it works!)
  • have a look at the BCAppKit and BCSequenceView, see if I can do something (at least write a couple of emails...)
  • help to get a more complete demo app with all of that
  • make BCSymbol more consistent (specifically have a 'symbolForChar:' method for all classes instead of current methods)
  • see if I can help to improve BCSequenceCodon

Scott's list:

  • Need symbol types that allow for soft and hard masking (BCSymbolSet)
  • Init with NSData verifies symbol set (BCSequence)
  • Memory efficient reading of sequences to handle whole genomes (BCSequenceReader)
  • Add protein sequence support in suffix array (BCSuffixArray)
  • Break up suffix array too large for memory into smaller ones on disk, then merge
  • Add test cases for BCSuffixArray
  • Add dev doc for BCSuffixArray
  • Finish maximum common prefix class (BCMCP)
  • Add test cases for BCMCP
  • Add dev doc for BCMCP
  • Multi-core thread support

Back to index

biococoa-2.2.2/BioCocoa.xcodeproj/mac.mode1000644 000765 000024 00000120344 10404057133 021077 0ustar00scottcstaff000000 000000 ActivePerspectiveName Project AllowedModules BundleLoadPath MaxInstances n Module PBXSmartGroupTreeModule Name Groups and Files Outline View BundleLoadPath MaxInstances n Module PBXNavigatorGroup Name Editor BundleLoadPath MaxInstances n Module XCTaskListModule Name Task List BundleLoadPath MaxInstances n Module XCDetailModule Name File and Smart Group Detail Viewer BundleLoadPath MaxInstances 1 Module PBXBuildResultsModule Name Detailed Build Results Viewer BundleLoadPath MaxInstances 1 Module PBXProjectFindModule Name Project Batch Find Tool BundleLoadPath MaxInstances n Module PBXRunSessionModule Name Run Log BundleLoadPath MaxInstances n Module PBXBookmarksModule Name Bookmarks Tool BundleLoadPath MaxInstances n Module PBXClassBrowserModule Name Class Browser BundleLoadPath MaxInstances n Module PBXCVSModule Name Source Code Control Tool BundleLoadPath MaxInstances n Module PBXDebugBreakpointsModule Name Debug Breakpoints Tool BundleLoadPath MaxInstances n Module XCDockableInspector Name Inspector BundleLoadPath MaxInstances n Module PBXOpenQuicklyModule Name Open Quickly Tool BundleLoadPath MaxInstances 1 Module PBXDebugSessionModule Name Debugger BundleLoadPath MaxInstances 1 Module PBXDebugCLIModule Name Debug Console Description DefaultDescriptionKey DockingSystemVisible Extension mode1 FavBarConfig PBXProjectModuleGUID 0448157B09BCC4E800B8FA97 XCBarModuleItemNames XCBarModuleItems FirstTimeWindowDisplayed Identifier com.apple.perspectives.project.mode1 MajorVersion 31 MinorVersion 1 Name Default Notifications OpenEditors PerspectiveWidths -1 -1 Perspectives ChosenToolbarItems active-target-popup action NSToolbarFlexibleSpaceItem build build-and-run clean-target debug get-info toggle-editor NSToolbarFlexibleSpaceItem com.apple.pbx.toolbar.searchfield ControllerClassBaseName IconName WindowOfProjectWithEditor Identifier perspective.project IsVertical Layout BecomeActive ContentConfiguration PBXBottomSmartGroupGIDs 1C37FBAC04509CD000000102 1C37FAAC04509CD000000102 1C08E77C0454961000C914BD 1C37FABC05509CD000000102 1C37FABC05539CD112110102 E2644B35053B69B200211256 1C37FABC04509CD000100104 1CC0EA4004350EF90044410B 1CC0EA4004350EF90041110B PBXProjectModuleGUID 1CE0B1FE06471DED0097A5F4 PBXProjectModuleLabel Files PBXProjectStructureProvided yes PBXSmartGroupTreeModuleColumnData PBXSmartGroupTreeModuleColumnWidthsKey 238 PBXSmartGroupTreeModuleColumnsKey_v4 MainColumn PBXSmartGroupTreeModuleOutlineStateKey_v7 PBXSmartGroupTreeModuleOutlineStateExpansionKey 29B97314FDCFA39411CA2CEA 1C37FBAC04509CD000000102 1C37FABC05509CD000000102 PBXSmartGroupTreeModuleOutlineStateSelectionKey 12 11 PBXSmartGroupTreeModuleOutlineStateVisibleRectKey {{0, 0}, {238, 914}} PBXTopSmartGroupGIDs XCIncludePerspectivesSwitch XCSharingToken com.apple.Xcode.GFSharingToken GeometryConfiguration Frame {{0, 0}, {255, 932}} GroupTreeTableConfiguration MainColumn 238 RubberWindowFrame 2 55 1622 973 0 0 1680 1028 Module PBXSmartGroupTreeModule Proportion 255pt Dock ContentConfiguration PBXProjectModuleGUID 1CE0B20306471E060097A5F4 PBXProjectModuleLabel about-tests.html PBXSplitModuleInNavigatorKey Split0 PBXProjectModuleGUID 1CE0B20406471E060097A5F4 PBXProjectModuleLabel about-tests.html _historyCapacity 0 bookmark 0465454709BDD07500E7688D history 0448159509BCC65A00B8FA97 0448159909BCC65A00B8FA97 044815C809BCD2AE00B8FA97 0448161609BDC62F00B8FA97 0448162609BDC66400B8FA97 0448165709BDC7CF00B8FA97 0448169209BDCA9E00B8FA97 0448169309BDCA9E00B8FA97 0465452C09BDD05700E7688D 0465452D09BDD05700E7688D 0465452E09BDD05700E7688D 0465452F09BDD05700E7688D 0465453009BDD05700E7688D prevStack 0448159B09BCC65A00B8FA97 0448159F09BCC65A00B8FA97 044815A009BCC65A00B8FA97 044815CA09BCD2AE00B8FA97 0448162809BDC66400B8FA97 0448162909BDC66400B8FA97 0448162A09BDC66400B8FA97 0448163909BDC6FD00B8FA97 0448163A09BDC6FD00B8FA97 0448165D09BDC7CF00B8FA97 0448169409BDCA9E00B8FA97 0448169509BDCA9E00B8FA97 0465453109BDD05700E7688D 0465453209BDD05700E7688D 0465453309BDD05700E7688D 0465453409BDD05700E7688D 0465453509BDD05700E7688D 0465453609BDD05700E7688D 0465453709BDD05700E7688D SplitCount 1 StatusBarVisibility GeometryConfiguration Frame {{0, 0}, {1362, 575}} RubberWindowFrame 2 55 1622 973 0 0 1680 1028 Module PBXNavigatorGroup Proportion 575pt ContentConfiguration PBXProjectModuleGUID 1CE0B20506471E060097A5F4 PBXProjectModuleLabel Detail GeometryConfiguration Frame {{0, 580}, {1362, 352}} RubberWindowFrame 2 55 1622 973 0 0 1680 1028 Module XCDetailModule Proportion 352pt Proportion 1362pt Name Project ServiceClasses XCModuleDock PBXSmartGroupTreeModule XCModuleDock PBXNavigatorGroup XCDetailModule TableOfContents 0465453909BDD05700E7688D 1CE0B1FE06471DED0097A5F4 0465453A09BDD05700E7688D 1CE0B20306471E060097A5F4 1CE0B20506471E060097A5F4 ToolbarConfiguration xcode.toolbar.config.default ControllerClassBaseName IconName WindowOfProject Identifier perspective.morph IsVertical 0 Layout BecomeActive 1 ContentConfiguration PBXBottomSmartGroupGIDs 1C37FBAC04509CD000000102 1C37FAAC04509CD000000102 1C08E77C0454961000C914BD 1C37FABC05509CD000000102 1C37FABC05539CD112110102 E2644B35053B69B200211256 1C37FABC04509CD000100104 1CC0EA4004350EF90044410B 1CC0EA4004350EF90041110B PBXProjectModuleGUID 11E0B1FE06471DED0097A5F4 PBXProjectModuleLabel Files PBXProjectStructureProvided yes PBXSmartGroupTreeModuleColumnData PBXSmartGroupTreeModuleColumnWidthsKey 186 PBXSmartGroupTreeModuleColumnsKey_v4 MainColumn PBXSmartGroupTreeModuleOutlineStateKey_v7 PBXSmartGroupTreeModuleOutlineStateExpansionKey 29B97314FDCFA39411CA2CEA 1C37FABC05509CD000000102 PBXSmartGroupTreeModuleOutlineStateSelectionKey 0 PBXSmartGroupTreeModuleOutlineStateVisibleRectKey {{0, 0}, {186, 337}} PBXTopSmartGroupGIDs XCIncludePerspectivesSwitch 1 XCSharingToken com.apple.Xcode.GFSharingToken GeometryConfiguration Frame {{0, 0}, {203, 355}} GroupTreeTableConfiguration MainColumn 186 RubberWindowFrame 373 269 690 397 0 0 1440 878 Module PBXSmartGroupTreeModule Proportion 100% Name Morph PreferredWidth 300 ServiceClasses XCModuleDock PBXSmartGroupTreeModule TableOfContents 11E0B1FE06471DED0097A5F4 ToolbarConfiguration xcode.toolbar.config.default.short PerspectivesBarVisible ShelfIsVisible SourceDescription file at '/System/Library/PrivateFrameworks/DevToolsInterface.framework/Versions/A/Resources/XCPerspectivesSpecificationMode1.xcperspec' StatusbarIsVisible TimeStamp 0.0 ToolbarDisplayMode 1 ToolbarIsVisible ToolbarSizeMode 1 Type Perspectives UpdateMessage The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? WindowJustification 5 WindowOrderList 0465454809BDD07500E7688D 0465454909BDD07500E7688D 044815D509BCD2C200B8FA97 1CD10A99069EF8BA00B06720 0465454409BDD06100E7688D 1C0AD2B3069F1EA900FABCE6 0448157D09BCC52600B8FA97 /Users/mac/Desktop/BioCocoa/trunk/BioCocoa.xcodeproj WindowString 2 55 1622 973 0 0 1680 1028 WindowTools FirstTimeWindowDisplayed Identifier windowTool.build IsVertical Layout Dock ContentConfiguration PBXProjectModuleGUID 1CD0528F0623707200166675 PBXProjectModuleLabel StatusBarVisibility GeometryConfiguration Frame {{0, 0}, {1203, 349}} RubberWindowFrame 263 110 1203 918 0 0 1680 1028 Module PBXNavigatorGroup Proportion 349pt BecomeActive ContentConfiguration PBXProjectModuleGUID XCMainBuildResultsModuleGUID PBXProjectModuleLabel Build XCBuildResultsTrigger_Collapse 1021 XCBuildResultsTrigger_Open 1011 GeometryConfiguration Frame {{0, 354}, {1203, 523}} RubberWindowFrame 263 110 1203 918 0 0 1680 1028 Module PBXBuildResultsModule Proportion 523pt Proportion 877pt Name Build Results ServiceClasses PBXBuildResultsModule StatusbarIsVisible TableOfContents 0448157D09BCC52600B8FA97 0465452709BDD02A00E7688D 1CD0528F0623707200166675 XCMainBuildResultsModuleGUID ToolbarConfiguration xcode.toolbar.config.build WindowString 263 110 1203 918 0 0 1680 1028 WindowToolGUID 0448157D09BCC52600B8FA97 WindowToolIsVisible FirstTimeWindowDisplayed Identifier windowTool.debugger IsVertical Layout Dock ContentConfiguration Debugger HorizontalSplitView _collapsingFrameDimension 0.0 _indexOfCollapsedView 0 _percentageOfCollapsedView 0.0 isCollapsed yes sizes {{0, 0}, {291, 160}} {{291, 0}, {403, 160}} VerticalSplitView _collapsingFrameDimension 0.0 _indexOfCollapsedView 0 _percentageOfCollapsedView 0.0 isCollapsed yes sizes {{0, 0}, {694, 160}} {{0, 160}, {694, 221}} LauncherConfigVersion 8 PBXProjectModuleGUID 1C162984064C10D400B95A72 PBXProjectModuleLabel Debug - GLUTExamples (Underwater) GeometryConfiguration DebugConsoleDrawerSize {100, 120} DebugConsoleVisible None DebugConsoleWindowFrame {{200, 200}, {500, 300}} DebugSTDIOWindowFrame {{200, 200}, {500, 300}} Frame {{0, 0}, {694, 381}} RubberWindowFrame 244 307 694 422 0 0 1680 1028 Module PBXDebugSessionModule Proportion 381pt Proportion 381pt Name Debugger ServiceClasses PBXDebugSessionModule StatusbarIsVisible TableOfContents 1CD10A99069EF8BA00B06720 0465453E09BDD06100E7688D 1C162984064C10D400B95A72 0465453F09BDD06100E7688D 0465454009BDD06100E7688D 0465454109BDD06100E7688D 0465454209BDD06100E7688D 0465454309BDD06100E7688D 0465454409BDD06100E7688D ToolbarConfiguration xcode.toolbar.config.debug WindowString 244 307 694 422 0 0 1680 1028 WindowToolGUID 1CD10A99069EF8BA00B06720 WindowToolIsVisible Identifier windowTool.find Layout Dock Dock ContentConfiguration PBXProjectModuleGUID 1CDD528C0622207200134675 PBXProjectModuleLabel <No Editor> PBXSplitModuleInNavigatorKey Split0 PBXProjectModuleGUID 1CD0528D0623707200166675 SplitCount 1 StatusBarVisibility 1 GeometryConfiguration Frame {{0, 0}, {781, 167}} RubberWindowFrame 62 385 781 470 0 0 1440 878 Module PBXNavigatorGroup Proportion 781pt Proportion 50% BecomeActive 1 ContentConfiguration PBXProjectModuleGUID 1CD0528E0623707200166675 PBXProjectModuleLabel Project Find GeometryConfiguration Frame {{8, 0}, {773, 254}} RubberWindowFrame 62 385 781 470 0 0 1440 878 Module PBXProjectFindModule Proportion 50% Proportion 428pt Name Project Find ServiceClasses PBXProjectFindModule StatusbarIsVisible 1 TableOfContents 1C530D57069F1CE1000CFCEE 1C530D58069F1CE1000CFCEE 1C530D59069F1CE1000CFCEE 1CDD528C0622207200134675 1C530D5A069F1CE1000CFCEE 1CE0B1FE06471DED0097A5F4 1CD0528E0623707200166675 WindowString 62 385 781 470 0 0 1440 878 WindowToolGUID 1C530D57069F1CE1000CFCEE WindowToolIsVisible 0 Identifier MENUSEPARATOR FirstTimeWindowDisplayed Identifier windowTool.debuggerConsole IsVertical Layout Dock ContentConfiguration PBXProjectModuleGUID 1C78EAAC065D492600B07095 PBXProjectModuleLabel Debugger Console GeometryConfiguration Frame {{0, 0}, {440, 358}} RubberWindowFrame 63 559 440 400 0 0 1680 1028 Module PBXDebugCLIModule Proportion 358pt Proportion 359pt Name Debugger Console ServiceClasses PBXDebugCLIModule StatusbarIsVisible TableOfContents 044815D509BCD2C200B8FA97 0465454509BDD06100E7688D 1C78EAAC065D492600B07095 WindowString 63 559 440 400 0 0 1680 1028 WindowToolGUID 044815D509BCD2C200B8FA97 WindowToolIsVisible FirstTimeWindowDisplayed Identifier windowTool.run IsVertical Layout Dock ContentConfiguration LauncherConfigVersion 3 PBXProjectModuleGUID 1CD0528B0623707200166675 PBXProjectModuleLabel Run Runner HorizontalSplitView _collapsingFrameDimension 0.0 _indexOfCollapsedView 0 _percentageOfCollapsedView 0.0 isCollapsed yes sizes {{0, 0}, {367, 168}} {{0, 173}, {367, 270}} VerticalSplitView _collapsingFrameDimension 0.0 _indexOfCollapsedView 0 _percentageOfCollapsedView 0.0 isCollapsed yes sizes {{0, 0}, {406, 443}} {{411, 0}, {517, 443}} GeometryConfiguration Frame {{0, 0}, {991, 236}} RubberWindowFrame 21 728 991 277 0 0 1680 1028 Module PBXRunSessionModule Proportion 236pt Proportion 236pt Name Run Log ServiceClasses PBXRunSessionModule StatusbarIsVisible TableOfContents 1C0AD2B3069F1EA900FABCE6 0465453B09BDD05700E7688D 1CD0528B0623707200166675 0465453C09BDD05700E7688D ToolbarConfiguration xcode.toolbar.config.run WindowString 21 728 991 277 0 0 1680 1028 WindowToolGUID 1C0AD2B3069F1EA900FABCE6 WindowToolIsVisible Identifier windowTool.scm Layout Dock ContentConfiguration PBXProjectModuleGUID 1C78EAB2065D492600B07095 PBXProjectModuleLabel <No Editor> PBXSplitModuleInNavigatorKey Split0 PBXProjectModuleGUID 1C78EAB3065D492600B07095 SplitCount 1 StatusBarVisibility 1 GeometryConfiguration Frame {{0, 0}, {452, 0}} RubberWindowFrame 743 379 452 308 0 0 1280 1002 Module PBXNavigatorGroup Proportion 0pt BecomeActive 1 ContentConfiguration PBXProjectModuleGUID 1CD052920623707200166675 PBXProjectModuleLabel SCM GeometryConfiguration ConsoleFrame {{0, 259}, {452, 0}} Frame {{0, 7}, {452, 259}} RubberWindowFrame 743 379 452 308 0 0 1280 1002 TableConfiguration Status 30 FileName 199 Path 197.09500122070312 TableFrame {{0, 0}, {452, 250}} Module PBXCVSModule Proportion 262pt Proportion 266pt Name SCM ServiceClasses PBXCVSModule StatusbarIsVisible 1 TableOfContents 1C78EAB4065D492600B07095 1C78EAB5065D492600B07095 1C78EAB2065D492600B07095 1CD052920623707200166675 ToolbarConfiguration xcode.toolbar.config.scm WindowString 743 379 452 308 0 0 1280 1002 Identifier windowTool.breakpoints IsVertical 0 Layout Dock BecomeActive 1 ContentConfiguration PBXBottomSmartGroupGIDs 1C77FABC04509CD000000102 PBXProjectModuleGUID 1CE0B1FE06471DED0097A5F4 PBXProjectModuleLabel Files PBXProjectStructureProvided no PBXSmartGroupTreeModuleColumnData PBXSmartGroupTreeModuleColumnWidthsKey 168 PBXSmartGroupTreeModuleColumnsKey_v4 MainColumn PBXSmartGroupTreeModuleOutlineStateKey_v7 PBXSmartGroupTreeModuleOutlineStateExpansionKey 1C77FABC04509CD000000102 PBXSmartGroupTreeModuleOutlineStateSelectionKey 0 PBXSmartGroupTreeModuleOutlineStateVisibleRectKey {{0, 0}, {168, 350}} PBXTopSmartGroupGIDs XCIncludePerspectivesSwitch 0 GeometryConfiguration Frame {{0, 0}, {185, 368}} GroupTreeTableConfiguration MainColumn 168 RubberWindowFrame 315 424 744 409 0 0 1440 878 Module PBXSmartGroupTreeModule Proportion 185pt ContentConfiguration PBXProjectModuleGUID 1CA1AED706398EBD00589147 PBXProjectModuleLabel Detail GeometryConfiguration Frame {{190, 0}, {554, 368}} RubberWindowFrame 315 424 744 409 0 0 1440 878 Module XCDetailModule Proportion 554pt Proportion 368pt MajorVersion 2 MinorVersion 0 Name Breakpoints ServiceClasses PBXSmartGroupTreeModule XCDetailModule StatusbarIsVisible 1 TableOfContents 1CDDB66807F98D9800BB5817 1CDDB66907F98D9800BB5817 1CE0B1FE06471DED0097A5F4 1CA1AED706398EBD00589147 ToolbarConfiguration xcode.toolbar.config.breakpoints WindowString 315 424 744 409 0 0 1440 878 WindowToolGUID 1CDDB66807F98D9800BB5817 WindowToolIsVisible 1 Identifier windowTool.debugAnimator Layout Dock Module PBXNavigatorGroup Proportion 100% Proportion 100% Name Debug Visualizer ServiceClasses PBXNavigatorGroup StatusbarIsVisible 1 ToolbarConfiguration xcode.toolbar.config.debugAnimator WindowString 100 100 700 500 0 0 1280 1002 Identifier windowTool.bookmarks Layout Dock Module PBXBookmarksModule Proportion 100% Proportion 100% Name Bookmarks ServiceClasses PBXBookmarksModule StatusbarIsVisible 0 WindowString 538 42 401 187 0 0 1280 1002 Identifier windowTool.classBrowser Layout Dock BecomeActive 1 ContentConfiguration OptionsSetName Hierarchy, all classes PBXProjectModuleGUID 1CA6456E063B45B4001379D8 PBXProjectModuleLabel Class Browser - NSObject GeometryConfiguration ClassesFrame {{0, 0}, {374, 96}} ClassesTreeTableConfiguration PBXClassNameColumnIdentifier 208 PBXClassBookColumnIdentifier 22 Frame {{0, 0}, {630, 331}} MembersFrame {{0, 105}, {374, 395}} MembersTreeTableConfiguration PBXMemberTypeIconColumnIdentifier 22 PBXMemberNameColumnIdentifier 216 PBXMemberTypeColumnIdentifier 97 PBXMemberBookColumnIdentifier 22 PBXModuleWindowStatusBarHidden2 1 RubberWindowFrame 385 179 630 352 0 0 1440 878 Module PBXClassBrowserModule Proportion 332pt Proportion 332pt Name Class Browser ServiceClasses PBXClassBrowserModule StatusbarIsVisible 0 TableOfContents 1C0AD2AF069F1E9B00FABCE6 1C0AD2B0069F1E9B00FABCE6 1CA6456E063B45B4001379D8 ToolbarConfiguration xcode.toolbar.config.classbrowser WindowString 385 179 630 352 0 0 1440 878 WindowToolGUID 1C0AD2AF069F1E9B00FABCE6 WindowToolIsVisible 0 biococoa-2.2.2/BioCocoa.xcodeproj/mac.pbxuser000644 000765 000024 00000044341 10404057133 021564 0ustar00scottcstaff000000 000000 // !$*UTF8*$! { 0448155609BCC4B700B8FA97 /* Demo - Peptides */ = { isa = PBXExecutable; activeArgIndex = 2147483647; activeArgIndices = ( ); argumentStrings = ( ); autoAttachOnCrash = 1; configStateDict = { }; customDataFormattersEnabled = 1; debuggerPlugin = GDBDebugging; disassemblyDisplayState = 0; dylibVariantSuffix = ""; enableDebugStr = 1; environmentEntries = ( ); executableSystemSymbolLevel = 0; executableUserSymbolLevel = 0; libgmallocEnabled = 0; name = "Demo - Peptides"; savedGlobals = { }; sourceDirectories = ( ); }; 0448155709BCC4B700B8FA97 /* Demo - SequenceConverter */ = { isa = PBXExecutable; activeArgIndex = 2147483647; activeArgIndices = ( ); argumentStrings = ( ); autoAttachOnCrash = 1; configStateDict = { }; customDataFormattersEnabled = 1; debuggerPlugin = GDBDebugging; disassemblyDisplayState = 0; dylibVariantSuffix = ""; enableDebugStr = 1; environmentEntries = ( ); executableSystemSymbolLevel = 0; executableUserSymbolLevel = 0; libgmallocEnabled = 0; name = "Demo - SequenceConverter"; sourceDirectories = ( ); }; 0448155809BCC4B700B8FA97 /* Demo - Translation */ = { isa = PBXExecutable; activeArgIndex = 2147483647; activeArgIndices = ( ); argumentStrings = ( ); autoAttachOnCrash = 1; configStateDict = { }; customDataFormattersEnabled = 1; debuggerPlugin = GDBDebugging; disassemblyDisplayState = 0; dylibVariantSuffix = ""; enableDebugStr = 1; environmentEntries = ( ); executableSystemSymbolLevel = 0; executableUserSymbolLevel = 0; libgmallocEnabled = 0; name = "Demo - Translation"; savedGlobals = { }; sourceDirectories = ( ); }; 0448156409BCC4CE00B8FA97 /* Source Control */ = { isa = PBXSourceControlManager; fallbackIsa = XCSourceControlManager; isSCMEnabled = 0; scmConfiguration = { }; scmType = ""; }; 0448156509BCC4CE00B8FA97 /* Code sense */ = { isa = PBXCodeSenseManager; indexTemplatePath = ""; }; 0448156809BCC4DC00B8FA97 /* about-tests.html */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1321, 1988}}"; sepNavSelRange = "{0, 0}"; sepNavVisRect = "{{0, 0}, {1321, 558}}"; }; }; 0448159509BCC65A00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 04C2DB25065A5ED50015C8C7 /* BCReader.m */; name = "BCReader.m: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 1923; vrLoc = 0; }; 0448159909BCC65A00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 5D5A0B3707CC19D900578AA1 /* BCSequenceView.m */; name = "BCSequenceView.m: 28"; rLen = 0; rLoc = 475; rType = 0; vrLen = 1650; vrLoc = 0; }; 0448159B09BCC65A00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 04C2DB25065A5ED50015C8C7 /* BCReader.m */; name = "BCReader.m: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 1923; vrLoc = 0; }; 0448159F09BCC65A00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 5DB9BD7A07D5488500B4C5E3 /* BCAppKitDefines.h */; name = "BCAppKitDefines.h: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 368; vrLoc = 0; }; 044815A009BCC65A00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 5D5A0B3707CC19D900578AA1 /* BCSequenceView.m */; name = "BCSequenceView.m: 28"; rLen = 0; rLoc = 475; rType = 0; vrLen = 1650; vrLoc = 0; }; 044815C809BCD2AE00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 04C2DB23065A5ED50015C8C7 /* BCCreator.m */; name = "BCCreator.m: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 2104; vrLoc = 0; }; 044815CA09BCD2AE00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 04C2DB23065A5ED50015C8C7 /* BCCreator.m */; name = "BCCreator.m: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 2104; vrLoc = 0; }; 0448160209BDC4BC00B8FA97 /* Info-BioCocoa.plist */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1373, 558}}"; sepNavSelRange = "{0, 0}"; sepNavVisRect = "{{0, 0}, {1373, 558}}"; }; }; 0448160509BDC50E00B8FA97 /* XCBreakpointsBucket */ = { isa = XCBreakpointsBucket; name = "Project Breakpoints"; objects = ( ); }; 0448161609BDC62F00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 5DB9BD7A07D5488500B4C5E3 /* BCAppKitDefines.h */; name = "BCAppKitDefines.h: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 368; vrLoc = 0; }; 0448162609BDC66400B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0448156909BCC4DC00B8FA97 /* bc.css */; name = "bc.css: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 417; vrLoc = 0; }; 0448162809BDC66400B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0448160209BDC4BC00B8FA97 /* Info-BioCocoa.plist */; name = "Info-BioCocoa.plist: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 718; vrLoc = 0; }; 0448162909BDC66400B8FA97 /* PBXBookmark */ = { isa = PBXBookmark; fRef = 049D0E10054ED30C00000102 /* BC.icns */; }; 0448162A09BDC66400B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0448156909BCC4DC00B8FA97 /* bc.css */; name = "bc.css: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 417; vrLoc = 0; }; 0448162D09BDC6A100B8FA97 /* BCStringDefinitions.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1321, 630}}"; sepNavSelRange = "{0, 0}"; sepNavVisRect = "{{0, 0}, {1321, 558}}"; sepNavWindowFrame = "{{15, 114}, {1218, 909}}"; }; }; 0448162E09BDC6A100B8FA97 /* BCStringDefinitions.m */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1321, 910}}"; sepNavSelRange = "{0, 0}"; sepNavVisRect = "{{0, 0}, {1321, 910}}"; }; }; 0448163909BDC6FD00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 844A3E5F06D59FFA00423B33 /* BCAminoAcid.m */; name = "#import\t\"BCStringDefinitions.h\""; rLen = 32; rLoc = 185; rType = 0; vrLen = 1533; vrLoc = 0; }; 0448163A09BDC6FD00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = A684951D06F48F6600C6DE25 /* BCFoundation.h */; name = "BCFoundation.h: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 1060; vrLoc = 0; }; 0448165709BDC7CF00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = A684951D06F48F6600C6DE25 /* BCFoundation.h */; name = "BCFoundation.h: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 1060; vrLoc = 0; }; 0448165D09BDC7CF00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 844A3E5E06D59FFA00423B33 /* BCAminoAcid.h */; name = "BCAminoAcid.h: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 1031; vrLoc = 0; }; 0448169209BDCA9E00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0448162E09BDC6A100B8FA97 /* BCStringDefinitions.m */; name = "BCStringDefinitions.m: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 1547; vrLoc = 0; }; 0448169309BDCA9E00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0448162D09BDC6A100B8FA97 /* BCStringDefinitions.h */; name = "BCStringDefinitions.h: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 1407; vrLoc = 0; }; 0448169409BDCA9E00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0448162D09BDC6A100B8FA97 /* BCStringDefinitions.h */; name = "BCStringDefinitions.h: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 1407; vrLoc = 0; }; 0448169509BDCA9E00B8FA97 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0448162E09BDC6A100B8FA97 /* BCStringDefinitions.m */; name = "BCStringDefinitions.m: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 1547; vrLoc = 0; }; 0465451609BDCF8200E7688D /* Resources */ = { isa = PBXFileReference; lastKnownFileType = folder; name = Resources; path = /Users/mac/Desktop/BioCocoa/trunk/Resources; sourceTree = ""; }; 0465452C09BDD05700E7688D /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 844A3E5F06D59FFA00423B33 /* BCAminoAcid.m */; name = "#import\t\"BCStringDefinitions.h\""; rLen = 32; rLoc = 185; rType = 0; vrLen = 1533; vrLoc = 0; }; 0465452D09BDD05700E7688D /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 844A3E5E06D59FFA00423B33 /* BCAminoAcid.h */; name = "BCAminoAcid.h: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 1031; vrLoc = 0; }; 0465452E09BDD05700E7688D /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0448160209BDC4BC00B8FA97 /* Info-BioCocoa.plist */; name = "Info-BioCocoa.plist: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 718; vrLoc = 0; }; 0465452F09BDD05700E7688D /* PBXBookmark */ = { isa = PBXBookmark; fRef = 5D13BE0707F7BA8400F18D90 /* BC.icns */; }; 0465453009BDD05700E7688D /* PBXBookmark */ = { isa = PBXBookmark; fRef = 0448156809BCC4DC00B8FA97 /* about-tests.html */; }; 0465453109BDD05700E7688D /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 844A3E5F06D59FFA00423B33 /* BCAminoAcid.m */; name = "#import\t\"BCStringDefinitions.h\""; rLen = 32; rLoc = 185; rType = 0; vrLen = 1533; vrLoc = 0; }; 0465453209BDD05700E7688D /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 844A3E5E06D59FFA00423B33 /* BCAminoAcid.h */; name = "BCAminoAcid.h: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 1031; vrLoc = 0; }; 0465453309BDD05700E7688D /* PBXBookmark */ = { isa = PBXBookmark; fRef = 049D0E10054ED30C00000102 /* BC.icns */; }; 0465453409BDD05700E7688D /* PBXBookmark */ = { isa = PBXBookmark; fRef = 0465451609BDCF8200E7688D /* Resources */; }; 0465453509BDD05700E7688D /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0448160209BDC4BC00B8FA97 /* Info-BioCocoa.plist */; name = "Info-BioCocoa.plist: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 718; vrLoc = 0; }; 0465453609BDD05700E7688D /* PBXBookmark */ = { isa = PBXBookmark; fRef = 5D13BE0707F7BA8400F18D90 /* BC.icns */; }; 0465453709BDD05700E7688D /* PBXBookmark */ = { isa = PBXBookmark; fRef = 5D13BE0707F7BA8400F18D90 /* BC.icns */; }; 0465454709BDD07500E7688D /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0448156809BCC4DC00B8FA97 /* about-tests.html */; name = "about-tests.html: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 1673; vrLoc = 0; }; 04C2DB23065A5ED50015C8C7 /* BCCreator.m */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1373, 4732}}"; sepNavSelRange = "{0, 0}"; sepNavVisRect = "{{0, 0}, {1373, 910}}"; }; }; 04C2DB25065A5ED50015C8C7 /* BCReader.m */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1373, 11830}}"; sepNavSelRange = "{0, 0}"; sepNavVisRect = "{{0, 0}, {1373, 910}}"; }; }; 29B97313FDCFA39411CA2CEA /* Project object */ = { activeBuildConfigurationName = Development; activeBuildStyle = 4A9504CCFFE6A4B311CA0CBA /* Development */; activeExecutable = 0448155809BCC4B700B8FA97 /* Demo - Translation */; activeTarget = 4802002E07D424F100D236DF /* BioCocoa */; addToTargets = ( 4802002E07D424F100D236DF /* BioCocoa */, ); breakpointsGroup = 0448160509BDC50E00B8FA97 /* XCBreakpointsBucket */; codeSenseManager = 0448156509BCC4CE00B8FA97 /* Code sense */; executables = ( 0448155609BCC4B700B8FA97 /* Demo - Peptides */, 0448155709BCC4B700B8FA97 /* Demo - SequenceConverter */, 0448155809BCC4B700B8FA97 /* Demo - Translation */, ); perUserDictionary = { PBXConfiguration.PBXFileTableDataSource3.PBXErrorsWarningsDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXErrorsWarningsDataSource_LocationID; PBXFileTableDataSourceColumnWidthsKey = ( 20, 516, 797, ); PBXFileTableDataSourceColumnsKey = ( PBXErrorsWarningsDataSource_TypeID, PBXErrorsWarningsDataSource_MessageID, PBXErrorsWarningsDataSource_LocationID, ); }; PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, 1000, 20, 48, 43, 43, 20, ); PBXFileTableDataSourceColumnsKey = ( PBXFileDataSource_FiletypeID, PBXFileDataSource_Filename_ColumnID, PBXFileDataSource_Built_ColumnID, PBXFileDataSource_ObjectSize_ColumnID, PBXFileDataSource_Errors_ColumnID, PBXFileDataSource_Warnings_ColumnID, PBXFileDataSource_Target_ColumnID, ); }; PBXConfiguration.PBXFileTableDataSource3.PBXFindDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXFindDataSource_LocationID; PBXFileTableDataSourceColumnWidthsKey = ( 200, 120, ); PBXFileTableDataSourceColumnsKey = ( PBXFindDataSource_MessageID, PBXFindDataSource_LocationID, ); }; PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, 200, 943, 20, 48, 43, 43, ); PBXFileTableDataSourceColumnsKey = ( PBXFileDataSource_FiletypeID, PBXFileDataSource_Filename_ColumnID, PBXTargetDataSource_PrimaryAttribute, PBXFileDataSource_Built_ColumnID, PBXFileDataSource_ObjectSize_ColumnID, PBXFileDataSource_Errors_ColumnID, PBXFileDataSource_Warnings_ColumnID, ); }; PBXPerProjectTemplateStateSaveDate = 163434302; PBXWorkspaceStateSaveDate = 163434302; }; perUserProjectItems = { 0448159509BCC65A00B8FA97 /* PBXTextBookmark */ = 0448159509BCC65A00B8FA97 /* PBXTextBookmark */; 0448159909BCC65A00B8FA97 /* PBXTextBookmark */ = 0448159909BCC65A00B8FA97 /* PBXTextBookmark */; 0448159B09BCC65A00B8FA97 /* PBXTextBookmark */ = 0448159B09BCC65A00B8FA97 /* PBXTextBookmark */; 0448159F09BCC65A00B8FA97 /* PBXTextBookmark */ = 0448159F09BCC65A00B8FA97 /* PBXTextBookmark */; 044815A009BCC65A00B8FA97 /* PBXTextBookmark */ = 044815A009BCC65A00B8FA97 /* PBXTextBookmark */; 044815C809BCD2AE00B8FA97 /* PBXTextBookmark */ = 044815C809BCD2AE00B8FA97 /* PBXTextBookmark */; 044815CA09BCD2AE00B8FA97 /* PBXTextBookmark */ = 044815CA09BCD2AE00B8FA97 /* PBXTextBookmark */; 0448161609BDC62F00B8FA97 /* PBXTextBookmark */ = 0448161609BDC62F00B8FA97 /* PBXTextBookmark */; 0448162609BDC66400B8FA97 /* PBXTextBookmark */ = 0448162609BDC66400B8FA97 /* PBXTextBookmark */; 0448162809BDC66400B8FA97 /* PBXTextBookmark */ = 0448162809BDC66400B8FA97 /* PBXTextBookmark */; 0448162909BDC66400B8FA97 /* PBXBookmark */ = 0448162909BDC66400B8FA97 /* PBXBookmark */; 0448162A09BDC66400B8FA97 /* PBXTextBookmark */ = 0448162A09BDC66400B8FA97 /* PBXTextBookmark */; 0448163909BDC6FD00B8FA97 /* PBXTextBookmark */ = 0448163909BDC6FD00B8FA97 /* PBXTextBookmark */; 0448163A09BDC6FD00B8FA97 /* PBXTextBookmark */ = 0448163A09BDC6FD00B8FA97 /* PBXTextBookmark */; 0448165709BDC7CF00B8FA97 /* PBXTextBookmark */ = 0448165709BDC7CF00B8FA97 /* PBXTextBookmark */; 0448165D09BDC7CF00B8FA97 /* PBXTextBookmark */ = 0448165D09BDC7CF00B8FA97 /* PBXTextBookmark */; 0448169209BDCA9E00B8FA97 /* PBXTextBookmark */ = 0448169209BDCA9E00B8FA97 /* PBXTextBookmark */; 0448169309BDCA9E00B8FA97 /* PBXTextBookmark */ = 0448169309BDCA9E00B8FA97 /* PBXTextBookmark */; 0448169409BDCA9E00B8FA97 /* PBXTextBookmark */ = 0448169409BDCA9E00B8FA97 /* PBXTextBookmark */; 0448169509BDCA9E00B8FA97 /* PBXTextBookmark */ = 0448169509BDCA9E00B8FA97 /* PBXTextBookmark */; 0465452C09BDD05700E7688D /* PBXTextBookmark */ = 0465452C09BDD05700E7688D /* PBXTextBookmark */; 0465452D09BDD05700E7688D /* PBXTextBookmark */ = 0465452D09BDD05700E7688D /* PBXTextBookmark */; 0465452E09BDD05700E7688D /* PBXTextBookmark */ = 0465452E09BDD05700E7688D /* PBXTextBookmark */; 0465452F09BDD05700E7688D /* PBXBookmark */ = 0465452F09BDD05700E7688D /* PBXBookmark */; 0465453009BDD05700E7688D /* PBXBookmark */ = 0465453009BDD05700E7688D /* PBXBookmark */; 0465453109BDD05700E7688D /* PBXTextBookmark */ = 0465453109BDD05700E7688D /* PBXTextBookmark */; 0465453209BDD05700E7688D /* PBXTextBookmark */ = 0465453209BDD05700E7688D /* PBXTextBookmark */; 0465453309BDD05700E7688D /* PBXBookmark */ = 0465453309BDD05700E7688D /* PBXBookmark */; 0465453409BDD05700E7688D /* PBXBookmark */ = 0465453409BDD05700E7688D /* PBXBookmark */; 0465453509BDD05700E7688D /* PBXTextBookmark */ = 0465453509BDD05700E7688D /* PBXTextBookmark */; 0465453609BDD05700E7688D /* PBXBookmark */ = 0465453609BDD05700E7688D /* PBXBookmark */; 0465453709BDD05700E7688D /* PBXBookmark */ = 0465453709BDD05700E7688D /* PBXBookmark */; 0465454709BDD07500E7688D /* PBXTextBookmark */ = 0465454709BDD07500E7688D /* PBXTextBookmark */; }; sourceControlManager = 0448156409BCC4CE00B8FA97 /* Source Control */; userBuildSettings = { }; }; 4802002E07D424F100D236DF /* BioCocoa */ = { activeExec = 0; }; 489E72A607D041B700CF2786 /* Test - BCFoundation */ = { activeExec = 0; }; 5D5A0B3707CC19D900578AA1 /* BCSequenceView.m */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1373, 3724}}"; sepNavSelRange = "{475, 0}"; sepNavVisRect = "{{0, 0}, {1373, 910}}"; }; }; 5DB9BD7A07D5488500B4C5E3 /* BCAppKitDefines.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1373, 558}}"; sepNavSelRange = "{0, 0}"; sepNavVisRect = "{{0, 0}, {1373, 558}}"; }; }; 844A3E5E06D59FFA00423B33 /* BCAminoAcid.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1373, 3024}}"; sepNavSelRange = "{0, 0}"; sepNavVisRect = "{{0, 0}, {1373, 558}}"; }; }; 844A3E5F06D59FFA00423B33 /* BCAminoAcid.m */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1321, 7854}}"; sepNavSelRange = "{185, 32}"; sepNavVisRect = "{{0, 0}, {1321, 558}}"; }; }; A62DB5C407ED8029006E8051 /* Demo - SequenceConverter */ = { activeExec = 0; executables = ( 0448155709BCC4B700B8FA97 /* Demo - SequenceConverter */, ); }; A62DB5E207ED8029006E8051 /* Demo - Translation */ = { activeExec = 0; executables = ( 0448155809BCC4B700B8FA97 /* Demo - Translation */, ); }; A62DB61F07ED8167006E8051 /* Demo - Peptides */ = { activeExec = 0; executables = ( 0448155609BCC4B700B8FA97 /* Demo - Peptides */, ); }; A684951D06F48F6600C6DE25 /* BCFoundation.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1373, 1050}}"; sepNavSelRange = "{0, 0}"; sepNavVisRect = "{{0, 0}, {1373, 558}}"; }; }; } biococoa-2.2.2/BioCocoa.xcodeproj/project.pbxproj000755 000765 000024 00000321104 11370700423 022464 0ustar00scottcstaff000000 000000 // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 42; objects = { /* Begin PBXAggregateTarget section */ D6CCD06D0EC0E0F60073F096 /* Documentation */ = { isa = PBXAggregateTarget; buildConfigurationList = D6CCD07D0EC0E0F70073F096 /* Build configuration list for PBXAggregateTarget "Documentation" */; buildPhases = ( D6CCD06C0EC0E0F60073F096 /* ShellScript */, ); dependencies = ( ); name = Documentation; productName = Documentation; }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ 0448157009BCC4DC00B8FA97 /* about-cvs.html in Resources */ = {isa = PBXBuildFile; fileRef = 0448156709BCC4DC00B8FA97 /* about-cvs.html */; }; 0448157109BCC4DC00B8FA97 /* about-tests.html in Resources */ = {isa = PBXBuildFile; fileRef = 0448156809BCC4DC00B8FA97 /* about-tests.html */; }; 0448157209BCC4DC00B8FA97 /* bc.css in Resources */ = {isa = PBXBuildFile; fileRef = 0448156909BCC4DC00B8FA97 /* bc.css */; }; 0448157309BCC4DC00B8FA97 /* biococoaxcode.html in Resources */ = {isa = PBXBuildFile; fileRef = 0448156A09BCC4DC00B8FA97 /* biococoaxcode.html */; }; 0448157409BCC4DC00B8FA97 /* headerdoc.html in Resources */ = {isa = PBXBuildFile; fileRef = 0448156B09BCC4DC00B8FA97 /* headerdoc.html */; }; 0448157509BCC4DC00B8FA97 /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 0448156C09BCC4DC00B8FA97 /* index.html */; }; 0448157609BCC4DC00B8FA97 /* newfiles.html in Resources */ = {isa = PBXBuildFile; fileRef = 0448156D09BCC4DC00B8FA97 /* newfiles.html */; }; 0448157709BCC4DC00B8FA97 /* newtargets.html in Resources */ = {isa = PBXBuildFile; fileRef = 0448156E09BCC4DC00B8FA97 /* newtargets.html */; }; 0448157809BCC4DC00B8FA97 /* todo.html in Resources */ = {isa = PBXBuildFile; fileRef = 0448156F09BCC4DC00B8FA97 /* todo.html */; }; 0448162F09BDC6A100B8FA97 /* BCStringDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0448162D09BDC6A100B8FA97 /* BCStringDefinitions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0448163009BDC6A100B8FA97 /* BCStringDefinitions.m in Sources */ = {isa = PBXBuildFile; fileRef = 0448162E09BDC6A100B8FA97 /* BCStringDefinitions.m */; }; 0465452309BDCFCE00E7688D /* BC.icns in Resources */ = {isa = PBXBuildFile; fileRef = 0465452209BDCFCE00E7688D /* BC.icns */; }; 4802003007D424F100D236DF /* BCSequence.h in Headers */ = {isa = PBXBuildFile; fileRef = 4897A0F807B34C960024883E /* BCSequence.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802003307D424F100D236DF /* BioCocoa_Prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = 04C2DB26065A5ED50015C8C7 /* BioCocoa_Prefix.h */; }; 4802003407D424F100D236DF /* BCUtilStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 04C2DB28065A5ED50015C8C7 /* BCUtilStrings.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802003907D424F100D236DF /* BCAminoAcid.h in Headers */ = {isa = PBXBuildFile; fileRef = 844A3E5E06D59FFA00423B33 /* BCAminoAcid.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802003A07D424F100D236DF /* BCNucleotideDNA.h in Headers */ = {isa = PBXBuildFile; fileRef = 844A3E6006D59FFA00423B33 /* BCNucleotideDNA.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802003B07D424F100D236DF /* BCSymbol.h in Headers */ = {isa = PBXBuildFile; fileRef = 844A3E6206D59FFA00423B33 /* BCSymbol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802003C07D424F100D236DF /* BCToolMassCalculator.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D54ABB06DE346700B93E1D /* BCToolMassCalculator.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802004107D424F100D236DF /* BCSymbolSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A6B8D58206F22B1C00D408DE /* BCSymbolSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802004307D424F100D236DF /* BCFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = A684951D06F48F6600C6DE25 /* BCFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802004407D424F100D236DF /* BCFoundationDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = A684951E06F48F6600C6DE25 /* BCFoundationDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802004507D424F100D236DF /* BCNucleotideRNA.h in Headers */ = {isa = PBXBuildFile; fileRef = 84476337070095540008A46C /* BCNucleotideRNA.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802004B07D424F100D236DF /* BCToolSymbolCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D583D92073087E4004AB031 /* BCToolSymbolCounter.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802004C07D424F100D236DF /* BCToolSequenceFinder.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA65F150731CE1000E4B0D9 /* BCToolSequenceFinder.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802004D07D424F100D236DF /* BCSequenceReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DC52C890741A9A000E772AB /* BCSequenceReader.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802004E07D424F100D236DF /* BCToolComplement.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DEB8F08074ED0200062A5DE /* BCToolComplement.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802004F07D424F100D236DF /* BCSequenceTool.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D6B438D0773BBE80020682B /* BCSequenceTool.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802005007D424F100D236DF /* BCAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = A6BC0D8A07CB89970084DA38 /* BCAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802005107D424F100D236DF /* BCSequenceView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D5A0B3607CC19D900578AA1 /* BCSequenceView.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802005207D424F100D236DF /* BCAppKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D4F377D07CEC219004B7241 /* BCAppKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802005407D424F100D236DF /* BCNucleotide.h in Headers */ = {isa = PBXBuildFile; fileRef = 8499CF1D07CFE68B00E71F3B /* BCNucleotide.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802005507D424F100D236DF /* BCToolDigest.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DD2B45D07D17C9D000436B2 /* BCToolDigest.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4802005807D424F100D236DF /* aminoacids.plist in Resources */ = {isa = PBXBuildFile; fileRef = 844A3E9406D5A16C00423B33 /* aminoacids.plist */; }; 4802005907D424F100D236DF /* nucleotides.plist in Resources */ = {isa = PBXBuildFile; fileRef = 844A3E9506D5A16C00423B33 /* nucleotides.plist */; }; 4802006007D424F100D236DF /* BCUtilStrings.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C2DB29065A5ED50015C8C7 /* BCUtilStrings.m */; }; 4802006107D424F100D236DF /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 04C2DB27065A5ED50015C8C7 /* main.c */; }; 4802006507D424F100D236DF /* BCAminoAcid.m in Sources */ = {isa = PBXBuildFile; fileRef = 844A3E5F06D59FFA00423B33 /* BCAminoAcid.m */; }; 4802006607D424F100D236DF /* BCNucleotideDNA.m in Sources */ = {isa = PBXBuildFile; fileRef = 844A3E6106D59FFA00423B33 /* BCNucleotideDNA.m */; }; 4802006707D424F100D236DF /* BCSymbol.m in Sources */ = {isa = PBXBuildFile; fileRef = 844A3E6306D59FFA00423B33 /* BCSymbol.m */; }; 4802006807D424F100D236DF /* BCToolMassCalculator.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D54ABC06DE346700B93E1D /* BCToolMassCalculator.m */; }; 4802006E07D424F100D236DF /* BCSymbolSet.m in Sources */ = {isa = PBXBuildFile; fileRef = A69A394506F2388E00A82E04 /* BCSymbolSet.m */; }; 4802006F07D424F100D236DF /* BCNucleotideRNA.m in Sources */ = {isa = PBXBuildFile; fileRef = 84476338070095540008A46C /* BCNucleotideRNA.m */; }; 4802007507D424F100D236DF /* BCToolSymbolCounter.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D583D93073087E4004AB031 /* BCToolSymbolCounter.m */; }; 4802007607D424F100D236DF /* BCToolSequenceFinder.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA65F160731CE1000E4B0D9 /* BCToolSequenceFinder.m */; }; 4802007707D424F100D236DF /* BCSequenceReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC52C8A0741A9A000E772AB /* BCSequenceReader.m */; }; 4802007807D424F100D236DF /* BCToolComplement.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DEB8F09074ED0200062A5DE /* BCToolComplement.m */; }; 4802007907D424F100D236DF /* BCSequenceTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D6B438E0773BBE80020682B /* BCSequenceTool.m */; }; 4802007A07D424F100D236DF /* BCSequence.m in Sources */ = {isa = PBXBuildFile; fileRef = 4897A0F907B34C960024883E /* BCSequence.m */; }; 4802007C07D424F100D236DF /* BCAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = A6BC0D8B07CB89970084DA38 /* BCAnnotation.m */; }; 4802007D07D424F100D236DF /* BCSequenceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D5A0B3707CC19D900578AA1 /* BCSequenceView.m */; }; 4802007F07D424F100D236DF /* BCNucleotide.m in Sources */ = {isa = PBXBuildFile; fileRef = 8499CF1E07CFE68B00E71F3B /* BCNucleotide.m */; }; 4802008007D424F100D236DF /* BCToolDigest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DD2B45E07D17C9D000436B2 /* BCToolDigest.m */; }; 4802008307D424F100D236DF /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 4818329307FFC4B800B42A19 /* BioCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4802008907D424F100D236DF /* BioCocoa.framework */; }; 48DCBB66081C62CC00C222EA /* Test-BCFoundation_Prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = 48DCBB5A081C62CB00C222EA /* Test-BCFoundation_Prefix.h */; }; 48DCBB6A081C62CC00C222EA /* TestBCSequenceInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 48DCBB5E081C62CC00C222EA /* TestBCSequenceInit.h */; }; 48DCBB6B081C62CC00C222EA /* TestBCSequenceInit.m in Sources */ = {isa = PBXBuildFile; fileRef = 48DCBB5F081C62CC00C222EA /* TestBCSequenceInit.m */; }; 48DCBB6C081C62CC00C222EA /* TestBCSequenceProperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 48DCBB60081C62CC00C222EA /* TestBCSequenceProperties.h */; }; 48DCBB6D081C62CC00C222EA /* TestBCSequenceProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 48DCBB61081C62CC00C222EA /* TestBCSequenceProperties.m */; }; 5D27F9AE0823B4AE0008A8CA /* BCToolHydropathyCalculator.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D27F9AC0823B4AE0008A8CA /* BCToolHydropathyCalculator.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D27F9AF0823B4AE0008A8CA /* BCToolHydropathyCalculator.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D27F9AD0823B4AE0008A8CA /* BCToolHydropathyCalculator.m */; }; 5D6D40940A8E1FEC00147C25 /* BCSequenceWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D6D40920A8E1FEC00147C25 /* BCSequenceWriter.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D6D40950A8E1FEC00147C25 /* BCSequenceWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D6D40930A8E1FEC00147C25 /* BCSequenceWriter.m */; }; 5D6F4F960891DE0B0072286F /* BCUtilData.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D6F4F940891DE0B0072286F /* BCUtilData.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D6F4F970891DE0B0072286F /* BCUtilData.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D6F4F950891DE0B0072286F /* BCUtilData.m */; }; 5D81C612088DD07500DEB16C /* BCCodon.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C607088DD07500DEB16C /* BCCodon.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C613088DD07500DEB16C /* BCCodon.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C608088DD07500DEB16C /* BCCodon.m */; }; 5D81C614088DD07500DEB16C /* BCCodonDNA.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C609088DD07500DEB16C /* BCCodonDNA.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C615088DD07500DEB16C /* BCCodonDNA.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C60A088DD07500DEB16C /* BCCodonDNA.m */; }; 5D81C616088DD07500DEB16C /* BCCodonRNA.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C60B088DD07500DEB16C /* BCCodonRNA.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C617088DD07500DEB16C /* BCCodonRNA.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C60C088DD07500DEB16C /* BCCodonRNA.m */; }; 5D81C618088DD07500DEB16C /* BCGeneticCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C60D088DD07500DEB16C /* BCGeneticCode.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C619088DD07500DEB16C /* BCGeneticCode.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C60E088DD07500DEB16C /* BCGeneticCode.m */; }; 5D81C61A088DD07500DEB16C /* universal genetic code.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5D81C610088DD07500DEB16C /* universal genetic code.plist */; }; 5D81C61B088DD07500DEB16C /* vertebrate mitochondrial genetic code.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5D81C611088DD07500DEB16C /* vertebrate mitochondrial genetic code.plist */; }; 5D81C626088DD14A00DEB16C /* BCToolTranslator.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C622088DD14A00DEB16C /* BCToolTranslator.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C627088DD14A00DEB16C /* BCToolTranslator.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C623088DD14A00DEB16C /* BCToolTranslator.m */; }; 5D81C628088DD14A00DEB16C /* BCToolTranslatorDNA.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C624088DD14A00DEB16C /* BCToolTranslatorDNA.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C629088DD14A00DEB16C /* BCToolTranslatorDNA.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C625088DD14A00DEB16C /* BCToolTranslatorDNA.m */; }; 5D81C641088DD28600DEB16C /* BCSequenceCodon.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C63F088DD28600DEB16C /* BCSequenceCodon.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C642088DD28600DEB16C /* BCSequenceCodon.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C640088DD28600DEB16C /* BCSequenceCodon.m */; }; 5D81C755088DED8E00DEB16C /* BCAtom.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C749088DED8E00DEB16C /* BCAtom.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C756088DED8E00DEB16C /* BCAtom.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C74A088DED8E00DEB16C /* BCAtom.m */; }; 5D81C757088DED8E00DEB16C /* BCChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C74B088DED8E00DEB16C /* BCChain.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C758088DED8E00DEB16C /* BCChain.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C74C088DED8E00DEB16C /* BCChain.m */; }; 5D81C759088DED8E00DEB16C /* BCProteinStructure.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C74D088DED8E00DEB16C /* BCProteinStructure.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C75A088DED8E00DEB16C /* BCProteinStructure.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C74E088DED8E00DEB16C /* BCProteinStructure.m */; }; 5D81C75B088DED8E00DEB16C /* BCResidue.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C74F088DED8E00DEB16C /* BCResidue.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C75C088DED8E00DEB16C /* BCResidue.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C750088DED8E00DEB16C /* BCResidue.m */; }; 5D81C75F088DED8E00DEB16C /* BCSequenceStructure.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C753088DED8E00DEB16C /* BCSequenceStructure.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C760088DED8E00DEB16C /* BCSequenceStructure.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C754088DED8E00DEB16C /* BCSequenceStructure.m */; }; 5D81C777088DEFFD00DEB16C /* BCSecondaryStructure.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C775088DEFFD00DEB16C /* BCSecondaryStructure.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C778088DEFFD00DEB16C /* BCSecondaryStructure.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C776088DEFFD00DEB16C /* BCSecondaryStructure.m */; }; 5D81C7B9088DF07600DEB16C /* BCPairwiseAlignment.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C7B3088DF07600DEB16C /* BCPairwiseAlignment.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C7BA088DF07600DEB16C /* BCPairwiseAlignment.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C7B4088DF07600DEB16C /* BCPairwiseAlignment.m */; }; 5D81C7BB088DF07600DEB16C /* BCScoreMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C7B5088DF07600DEB16C /* BCScoreMatrix.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C7BC088DF07600DEB16C /* BCScoreMatrix.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C7B6088DF07600DEB16C /* BCScoreMatrix.m */; }; 5D81C7BD088DF07600DEB16C /* BCSequenceAlignment.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D81C7B7088DF07600DEB16C /* BCSequenceAlignment.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D81C7BE088DF07700DEB16C /* BCSequenceAlignment.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D81C7B8088DF07600DEB16C /* BCSequenceAlignment.m */; }; 5D85BE7609D77D420059781C /* about-svn.html in Resources */ = {isa = PBXBuildFile; fileRef = 5D85BE7509D77D410059781C /* about-svn.html */; }; 5DB533F508F945970043BAC3 /* BCSequenceArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DB533F308F945970043BAC3 /* BCSequenceArray.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5DB533F608F945970043BAC3 /* BCSequenceArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DB533F408F945970043BAC3 /* BCSequenceArray.m */; }; 5DB9BD7B07D5488500B4C5E3 /* BCAppKitDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DB9BD7A07D5488500B4C5E3 /* BCAppKitDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; D62419AD0CB6BB2F008005CC /* BCInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = D62419AC0CB6BB2F008005CC /* BCInternal.h */; }; D64201350CA810C800946E18 /* TestBCSuffixArray.h in Headers */ = {isa = PBXBuildFile; fileRef = D64201330CA810C800946E18 /* TestBCSuffixArray.h */; }; D64201360CA810C800946E18 /* TestBCSuffixArray.m in Sources */ = {isa = PBXBuildFile; fileRef = D64201340CA810C800946E18 /* TestBCSuffixArray.m */; }; D642026F0CA9B78C00946E18 /* TestBCCachedSequenceFile.h in Headers */ = {isa = PBXBuildFile; fileRef = D642026D0CA9B78C00946E18 /* TestBCCachedSequenceFile.h */; }; D64202700CA9B78C00946E18 /* TestBCCachedSequenceFile.m in Sources */ = {isa = PBXBuildFile; fileRef = D642026E0CA9B78C00946E18 /* TestBCCachedSequenceFile.m */; }; D642F95C0C95A71400946E18 /* BCCachedSequenceFile.h in Headers */ = {isa = PBXBuildFile; fileRef = D642F95A0C95A71400946E18 /* BCCachedSequenceFile.h */; settings = {ATTRIBUTES = (Public, ); }; }; D642F95D0C95A71400946E18 /* BCCachedSequenceFile.m in Sources */ = {isa = PBXBuildFile; fileRef = D642F95B0C95A71400946E18 /* BCCachedSequenceFile.m */; }; D642F9720C95A9F000946E18 /* BCCachedFastaFile.h in Headers */ = {isa = PBXBuildFile; fileRef = D642F9700C95A9F000946E18 /* BCCachedFastaFile.h */; settings = {ATTRIBUTES = (Public, ); }; }; D642F9730C95A9F000946E18 /* BCCachedFastaFile.m in Sources */ = {isa = PBXBuildFile; fileRef = D642F9710C95A9F000946E18 /* BCCachedFastaFile.m */; }; D642FDC60CA2BC5E00946E18 /* TestBCSequenceReader.h in Headers */ = {isa = PBXBuildFile; fileRef = D642FDC40CA2BC5E00946E18 /* TestBCSequenceReader.h */; }; D642FDC70CA2BC5E00946E18 /* TestBCSequenceReader.m in Sources */ = {isa = PBXBuildFile; fileRef = D642FDC50CA2BC5E00946E18 /* TestBCSequenceReader.m */; }; D642FE440CA2CC8600946E18 /* pBR322 in Resources */ = {isa = PBXBuildFile; fileRef = D642FE430CA2CC8600946E18 /* pBR322 */; }; D642FE540CA2FC4B00946E18 /* UBBYB in Resources */ = {isa = PBXBuildFile; fileRef = D642FE530CA2FC4B00946E18 /* UBBYB */; }; D642FEAD0CA4592000946E18 /* hB2AR-CDS.xdna in Resources */ = {isa = PBXBuildFile; fileRef = D642FEA80CA4592000946E18 /* hB2AR-CDS.xdna */; }; D642FEAE0CA4592000946E18 /* hB2AR-protein.xprt in Resources */ = {isa = PBXBuildFile; fileRef = D642FEA90CA4592000946E18 /* hB2AR-protein.xprt */; }; D642FEAF0CA4592000946E18 /* hB26H-N,S oligos in Resources */ = {isa = PBXBuildFile; fileRef = D642FEAA0CA4592000946E18 /* hB26H-N,S oligos */; }; D642FEB00CA4592000946E18 /* pCDNA3.xdna in Resources */ = {isa = PBXBuildFile; fileRef = D642FEAB0CA4592000946E18 /* pCDNA3.xdna */; }; D642FEB10CA4592000946E18 /* pvL1392-SFhB26H in Resources */ = {isa = PBXBuildFile; fileRef = D642FEAC0CA4592000946E18 /* pvL1392-SFhB26H */; }; D642FF0E0CA45FF100946E18 /* test.fa in Resources */ = {isa = PBXBuildFile; fileRef = D642FF0B0CA45FF100946E18 /* test.fa */; }; D642FF0F0CA45FF100946E18 /* transposon.clustalw in Resources */ = {isa = PBXBuildFile; fileRef = D642FF0C0CA45FF100946E18 /* transposon.clustalw */; }; D642FF100CA45FF100946E18 /* transposon.fasta in Resources */ = {isa = PBXBuildFile; fileRef = D642FF0D0CA45FF100946E18 /* transposon.fasta */; }; D65244780C67CE5C00045868 /* BCMCP.h in Headers */ = {isa = PBXBuildFile; fileRef = D65244740C67CE5C00045868 /* BCMCP.h */; settings = {ATTRIBUTES = (Public, ); }; }; D65244790C67CE5C00045868 /* BCMCP.m in Sources */ = {isa = PBXBuildFile; fileRef = D65244750C67CE5C00045868 /* BCMCP.m */; }; D652447A0C67CE5C00045868 /* BCSuffixArray.h in Headers */ = {isa = PBXBuildFile; fileRef = D65244760C67CE5C00045868 /* BCSuffixArray.h */; settings = {ATTRIBUTES = (Public, ); }; }; D652447B0C67CE5C00045868 /* BCSuffixArray.m in Sources */ = {isa = PBXBuildFile; fileRef = D65244770C67CE5C00045868 /* BCSuffixArray.m */; }; D689018D0D4FDA7D003DFAEE /* Publications.txt in Resources */ = {isa = PBXBuildFile; fileRef = D689018C0D4FDA7D003DFAEE /* Publications.txt */; }; D68E13E60EBE224E00B29CF3 /* Authors.txt in Resources */ = {isa = PBXBuildFile; fileRef = D68E13E50EBE224E00B29CF3 /* Authors.txt */; }; D69310650C511444001936CC /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D69310500C511444001936CC /* SenTestingKit.framework */; }; D69620100E9BE16D008E791D /* BCGEODownloadController.h in Headers */ = {isa = PBXBuildFile; fileRef = D696200C0E9BE16D008E791D /* BCGEODownloadController.h */; settings = {ATTRIBUTES = (Public, ); }; }; D69620110E9BE16D008E791D /* BCGEODownloadController.m in Sources */ = {isa = PBXBuildFile; fileRef = D696200D0E9BE16D008E791D /* BCGEODownloadController.m */; }; D69620120E9BE16D008E791D /* BCSeriesTableController.h in Headers */ = {isa = PBXBuildFile; fileRef = D696200E0E9BE16D008E791D /* BCSeriesTableController.h */; settings = {ATTRIBUTES = (Public, ); }; }; D69620130E9BE16D008E791D /* BCSeriesTableController.m in Sources */ = {isa = PBXBuildFile; fileRef = D696200F0E9BE16D008E791D /* BCSeriesTableController.m */; }; D69620200E9BE1C1008E791D /* BCGEODownload.nib in Resources */ = {isa = PBXBuildFile; fileRef = D69620160E9BE1C1008E791D /* BCGEODownload.nib */; }; D69620210E9BE1C1008E791D /* BCPlatformTable.nib in Resources */ = {isa = PBXBuildFile; fileRef = D69620180E9BE1C1008E791D /* BCPlatformTable.nib */; }; D69620220E9BE1C1008E791D /* BCProbeTable.nib in Resources */ = {isa = PBXBuildFile; fileRef = D696201A0E9BE1C1008E791D /* BCProbeTable.nib */; }; D69620230E9BE1C1008E791D /* BCSampleTable.nib in Resources */ = {isa = PBXBuildFile; fileRef = D696201C0E9BE1C1008E791D /* BCSampleTable.nib */; }; D69620240E9BE1C1008E791D /* BCSeriesTable.nib in Resources */ = {isa = PBXBuildFile; fileRef = D696201E0E9BE1C1008E791D /* BCSeriesTable.nib */; }; D696202B0E9BE3DE008E791D /* BCPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = D69620290E9BE3DE008E791D /* BCPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; }; D696202C0E9BE3DE008E791D /* BCPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = D696202A0E9BE3DE008E791D /* BCPreferences.m */; }; D696203D0E9BE602008E791D /* BCParseSOFT.h in Headers */ = {isa = PBXBuildFile; fileRef = D69620350E9BE602008E791D /* BCParseSOFT.h */; settings = {ATTRIBUTES = (Public, ); }; }; D696203E0E9BE602008E791D /* BCParseSOFT.m in Sources */ = {isa = PBXBuildFile; fileRef = D69620360E9BE602008E791D /* BCParseSOFT.m */; }; D696203F0E9BE602008E791D /* BCPlatform.h in Headers */ = {isa = PBXBuildFile; fileRef = D69620370E9BE602008E791D /* BCPlatform.h */; settings = {ATTRIBUTES = (Public, ); }; }; D69620400E9BE602008E791D /* BCPlatform.m in Sources */ = {isa = PBXBuildFile; fileRef = D69620380E9BE602008E791D /* BCPlatform.m */; }; D69620410E9BE602008E791D /* BCSample.h in Headers */ = {isa = PBXBuildFile; fileRef = D69620390E9BE602008E791D /* BCSample.h */; settings = {ATTRIBUTES = (Public, ); }; }; D69620420E9BE602008E791D /* BCSample.m in Sources */ = {isa = PBXBuildFile; fileRef = D696203A0E9BE602008E791D /* BCSample.m */; }; D69620430E9BE602008E791D /* BCSeries.h in Headers */ = {isa = PBXBuildFile; fileRef = D696203B0E9BE602008E791D /* BCSeries.h */; settings = {ATTRIBUTES = (Public, ); }; }; D69620440E9BE602008E791D /* BCSeries.m in Sources */ = {isa = PBXBuildFile; fileRef = D696203C0E9BE602008E791D /* BCSeries.m */; }; D69620490E9BE613008E791D /* BCGeneExpressionOmnibus.h in Headers */ = {isa = PBXBuildFile; fileRef = D69620470E9BE613008E791D /* BCGeneExpressionOmnibus.h */; settings = {ATTRIBUTES = (Public, ); }; }; D696204A0E9BE613008E791D /* BCGeneExpressionOmnibus.m in Sources */ = {isa = PBXBuildFile; fileRef = D69620480E9BE613008E791D /* BCGeneExpressionOmnibus.m */; }; D69620500E9BE67A008E791D /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D696204F0E9BE67A008E791D /* CoreServices.framework */; }; D696205C0E9BE759008E791D /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D696205B0E9BE759008E791D /* SystemConfiguration.framework */; }; D69620890E9BFA21008E791D /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D69620880E9BFA21008E791D /* WebKit.framework */; }; D696213C0EA6A97E008E791D /* test.fastq in Resources */ = {isa = PBXBuildFile; fileRef = D696213B0EA6A97E008E791D /* test.fastq */; }; D69621620EA8FB59008E791D /* BCDataMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = D69621600EA8FB59008E791D /* BCDataMatrix.h */; settings = {ATTRIBUTES = (Public, ); }; }; D69621630EA8FB59008E791D /* BCDataMatrix.m in Sources */ = {isa = PBXBuildFile; fileRef = D69621610EA8FB59008E791D /* BCDataMatrix.m */; }; D69D050F10FFD0BE00F476C7 /* ChangeLog in Resources */ = {isa = PBXBuildFile; fileRef = D69D050E10FFD0BE00F476C7 /* ChangeLog */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 481832F207FFCA5B00B42A19 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; proxyType = 1; remoteGlobalIDString = 4802002E07D424F100D236DF; remoteInfo = BioCocoa; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 0448156709BCC4DC00B8FA97 /* about-cvs.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = "about-cvs.html"; sourceTree = ""; }; 0448156809BCC4DC00B8FA97 /* about-tests.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = "about-tests.html"; sourceTree = ""; }; 0448156909BCC4DC00B8FA97 /* bc.css */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = bc.css; sourceTree = ""; }; 0448156A09BCC4DC00B8FA97 /* biococoaxcode.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = biococoaxcode.html; sourceTree = ""; }; 0448156B09BCC4DC00B8FA97 /* headerdoc.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = headerdoc.html; sourceTree = ""; }; 0448156C09BCC4DC00B8FA97 /* index.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; 0448156D09BCC4DC00B8FA97 /* newfiles.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = newfiles.html; sourceTree = ""; }; 0448156E09BCC4DC00B8FA97 /* newtargets.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = newtargets.html; sourceTree = ""; }; 0448156F09BCC4DC00B8FA97 /* todo.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = todo.html; sourceTree = ""; }; 0448160209BDC4BC00B8FA97 /* Info-BioCocoa.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; name = "Info-BioCocoa.plist"; path = "Resources/Info-BioCocoa.plist"; sourceTree = ""; }; 0448162D09BDC6A100B8FA97 /* BCStringDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCStringDefinitions.h; path = BCFoundation/BCStringDefinitions.h; sourceTree = ""; }; 0448162E09BDC6A100B8FA97 /* BCStringDefinitions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCStringDefinitions.m; path = BCFoundation/BCStringDefinitions.m; sourceTree = ""; }; 0465452209BDCFCE00E7688D /* BC.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = BC.icns; path = Resources/BC.icns; sourceTree = ""; }; 049D0E10054ED30C00000102 /* BC.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = BC.icns; path = Resources/BC.icns; sourceTree = ""; }; 04C2DB26065A5ED50015C8C7 /* BioCocoa_Prefix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BioCocoa_Prefix.h; sourceTree = ""; }; 04C2DB27065A5ED50015C8C7 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; 04C2DB28065A5ED50015C8C7 /* BCUtilStrings.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCUtilStrings.h; path = BCFoundation/BCUtils/BCUtilStrings.h; sourceTree = SOURCE_ROOT; }; 04C2DB29065A5ED50015C8C7 /* BCUtilStrings.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCUtilStrings.m; path = BCFoundation/BCUtils/BCUtilStrings.m; sourceTree = SOURCE_ROOT; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 4802008907D424F100D236DF /* BioCocoa.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = BioCocoa.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4897A0F807B34C960024883E /* BCSequence.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCSequence.h; path = BCFoundation/BCSequence/BCSequence.h; sourceTree = ""; }; 4897A0F907B34C960024883E /* BCSequence.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCSequence.m; path = BCFoundation/BCSequence/BCSequence.m; sourceTree = ""; }; 489E72A707D041B700CF2786 /* Test - BCFoundation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = "Test - BCFoundation.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; 48DCBB5A081C62CB00C222EA /* Test-BCFoundation_Prefix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "Test-BCFoundation_Prefix.h"; path = "Tests/Test-BCFoundation/Test-BCFoundation_Prefix.h"; sourceTree = ""; }; 48DCBB5B081C62CC00C222EA /* Test-BCFoundation-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; name = "Test-BCFoundation-Info.plist"; path = "Tests/Test-BCFoundation/Test-BCFoundation-Info.plist"; sourceTree = ""; }; 48DCBB5E081C62CC00C222EA /* TestBCSequenceInit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TestBCSequenceInit.h; path = "Tests/Test-BCFoundation/TestBCSequenceInit.h"; sourceTree = ""; }; 48DCBB5F081C62CC00C222EA /* TestBCSequenceInit.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = TestBCSequenceInit.m; path = "Tests/Test-BCFoundation/TestBCSequenceInit.m"; sourceTree = ""; }; 48DCBB60081C62CC00C222EA /* TestBCSequenceProperties.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TestBCSequenceProperties.h; path = "Tests/Test-BCFoundation/TestBCSequenceProperties.h"; sourceTree = ""; }; 48DCBB61081C62CC00C222EA /* TestBCSequenceProperties.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = TestBCSequenceProperties.m; path = "Tests/Test-BCFoundation/TestBCSequenceProperties.m"; sourceTree = ""; }; 5D27F9AC0823B4AE0008A8CA /* BCToolHydropathyCalculator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCToolHydropathyCalculator.h; path = BCFoundation/BCTools/BCToolHydropathyCalculator.h; sourceTree = ""; }; 5D27F9AD0823B4AE0008A8CA /* BCToolHydropathyCalculator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCToolHydropathyCalculator.m; path = BCFoundation/BCTools/BCToolHydropathyCalculator.m; sourceTree = ""; }; 5D4F377D07CEC219004B7241 /* BCAppKit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCAppKit.h; path = BCAppKit/BCAppKit.h; sourceTree = ""; }; 5D583D92073087E4004AB031 /* BCToolSymbolCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCToolSymbolCounter.h; path = BCFoundation/BCTools/BCToolSymbolCounter.h; sourceTree = ""; }; 5D583D93073087E4004AB031 /* BCToolSymbolCounter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCToolSymbolCounter.m; path = BCFoundation/BCTools/BCToolSymbolCounter.m; sourceTree = ""; }; 5D5A0B3607CC19D900578AA1 /* BCSequenceView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCSequenceView.h; path = BCAppkit/BCSequenceView.h; sourceTree = ""; }; 5D5A0B3707CC19D900578AA1 /* BCSequenceView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCSequenceView.m; path = BCAppkit/BCSequenceView.m; sourceTree = ""; }; 5D6B438D0773BBE80020682B /* BCSequenceTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCSequenceTool.h; path = BCFoundation/BCTools/BCSequenceTool.h; sourceTree = ""; }; 5D6B438E0773BBE80020682B /* BCSequenceTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCSequenceTool.m; path = BCFoundation/BCTools/BCSequenceTool.m; sourceTree = ""; }; 5D6D40920A8E1FEC00147C25 /* BCSequenceWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCSequenceWriter.h; path = BCFoundation/BCSequenceIO/BCSequenceWriter.h; sourceTree = ""; }; 5D6D40930A8E1FEC00147C25 /* BCSequenceWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCSequenceWriter.m; path = BCFoundation/BCSequenceIO/BCSequenceWriter.m; sourceTree = ""; }; 5D6F4F940891DE0B0072286F /* BCUtilData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCUtilData.h; path = BCFoundation/BCUtils/BCUtilData.h; sourceTree = ""; }; 5D6F4F950891DE0B0072286F /* BCUtilData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCUtilData.m; path = BCFoundation/BCUtils/BCUtilData.m; sourceTree = ""; }; 5D81C607088DD07500DEB16C /* BCCodon.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BCCodon.h; sourceTree = ""; }; 5D81C608088DD07500DEB16C /* BCCodon.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BCCodon.m; sourceTree = ""; }; 5D81C609088DD07500DEB16C /* BCCodonDNA.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BCCodonDNA.h; sourceTree = ""; }; 5D81C60A088DD07500DEB16C /* BCCodonDNA.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BCCodonDNA.m; sourceTree = ""; }; 5D81C60B088DD07500DEB16C /* BCCodonRNA.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BCCodonRNA.h; sourceTree = ""; }; 5D81C60C088DD07500DEB16C /* BCCodonRNA.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BCCodonRNA.m; sourceTree = ""; }; 5D81C60D088DD07500DEB16C /* BCGeneticCode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BCGeneticCode.h; sourceTree = ""; }; 5D81C60E088DD07500DEB16C /* BCGeneticCode.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BCGeneticCode.m; sourceTree = ""; }; 5D81C610088DD07500DEB16C /* universal genetic code.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "universal genetic code.plist"; sourceTree = ""; }; 5D81C611088DD07500DEB16C /* vertebrate mitochondrial genetic code.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "vertebrate mitochondrial genetic code.plist"; sourceTree = ""; }; 5D81C622088DD14A00DEB16C /* BCToolTranslator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCToolTranslator.h; path = BCFoundation/BCTools/BCToolTranslator.h; sourceTree = ""; }; 5D81C623088DD14A00DEB16C /* BCToolTranslator.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCToolTranslator.m; path = BCFoundation/BCTools/BCToolTranslator.m; sourceTree = ""; }; 5D81C624088DD14A00DEB16C /* BCToolTranslatorDNA.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCToolTranslatorDNA.h; path = BCFoundation/BCTools/BCToolTranslatorDNA.h; sourceTree = ""; }; 5D81C625088DD14A00DEB16C /* BCToolTranslatorDNA.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCToolTranslatorDNA.m; path = BCFoundation/BCTools/BCToolTranslatorDNA.m; sourceTree = ""; }; 5D81C63F088DD28600DEB16C /* BCSequenceCodon.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCSequenceCodon.h; path = BCFoundation/BCSequence/BCSequenceCodon.h; sourceTree = ""; }; 5D81C640088DD28600DEB16C /* BCSequenceCodon.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCSequenceCodon.m; path = BCFoundation/BCSequence/BCSequenceCodon.m; sourceTree = ""; }; 5D81C749088DED8E00DEB16C /* BCAtom.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BCAtom.h; sourceTree = ""; }; 5D81C74A088DED8E00DEB16C /* BCAtom.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BCAtom.m; sourceTree = ""; }; 5D81C74B088DED8E00DEB16C /* BCChain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BCChain.h; sourceTree = ""; }; 5D81C74C088DED8E00DEB16C /* BCChain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BCChain.m; sourceTree = ""; }; 5D81C74D088DED8E00DEB16C /* BCProteinStructure.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BCProteinStructure.h; sourceTree = ""; }; 5D81C74E088DED8E00DEB16C /* BCProteinStructure.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BCProteinStructure.m; sourceTree = ""; }; 5D81C74F088DED8E00DEB16C /* BCResidue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BCResidue.h; sourceTree = ""; }; 5D81C750088DED8E00DEB16C /* BCResidue.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BCResidue.m; sourceTree = ""; }; 5D81C753088DED8E00DEB16C /* BCSequenceStructure.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BCSequenceStructure.h; sourceTree = ""; }; 5D81C754088DED8E00DEB16C /* BCSequenceStructure.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BCSequenceStructure.m; sourceTree = ""; }; 5D81C775088DEFFD00DEB16C /* BCSecondaryStructure.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BCSecondaryStructure.h; sourceTree = ""; }; 5D81C776088DEFFD00DEB16C /* BCSecondaryStructure.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BCSecondaryStructure.m; sourceTree = ""; }; 5D81C7B3088DF07600DEB16C /* BCPairwiseAlignment.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BCPairwiseAlignment.h; sourceTree = ""; }; 5D81C7B4088DF07600DEB16C /* BCPairwiseAlignment.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BCPairwiseAlignment.m; sourceTree = ""; }; 5D81C7B5088DF07600DEB16C /* BCScoreMatrix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BCScoreMatrix.h; sourceTree = ""; }; 5D81C7B6088DF07600DEB16C /* BCScoreMatrix.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BCScoreMatrix.m; sourceTree = ""; }; 5D81C7B7088DF07600DEB16C /* BCSequenceAlignment.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BCSequenceAlignment.h; sourceTree = ""; }; 5D81C7B8088DF07600DEB16C /* BCSequenceAlignment.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BCSequenceAlignment.m; sourceTree = ""; }; 5D85BE7509D77D410059781C /* about-svn.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = "about-svn.html"; sourceTree = ""; }; 5D85F85F0A72612300FD7194 /* license.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = license.txt; sourceTree = ""; }; 5DA65F150731CE1000E4B0D9 /* BCToolSequenceFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCToolSequenceFinder.h; path = BCFoundation/BCTools/BCToolSequenceFinder.h; sourceTree = ""; }; 5DA65F160731CE1000E4B0D9 /* BCToolSequenceFinder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCToolSequenceFinder.m; path = BCFoundation/BCTools/BCToolSequenceFinder.m; sourceTree = ""; }; 5DB533F308F945970043BAC3 /* BCSequenceArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCSequenceArray.h; path = BCFoundation/BCSequence/BCSequenceArray.h; sourceTree = ""; }; 5DB533F408F945970043BAC3 /* BCSequenceArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCSequenceArray.m; path = BCFoundation/BCSequence/BCSequenceArray.m; sourceTree = ""; }; 5DB9BD7A07D5488500B4C5E3 /* BCAppKitDefines.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCAppKitDefines.h; path = BCAppKit/BCAppKitDefines.h; sourceTree = ""; }; 5DC52C890741A9A000E772AB /* BCSequenceReader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCSequenceReader.h; path = BCFoundation/BCSequenceIO/BCSequenceReader.h; sourceTree = ""; }; 5DC52C8A0741A9A000E772AB /* BCSequenceReader.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCSequenceReader.m; path = BCFoundation/BCSequenceIO/BCSequenceReader.m; sourceTree = ""; }; 5DD2B45D07D17C9D000436B2 /* BCToolDigest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCToolDigest.h; path = BCFoundation/BCTools/BCToolDigest.h; sourceTree = ""; }; 5DD2B45E07D17C9D000436B2 /* BCToolDigest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCToolDigest.m; path = BCFoundation/BCTools/BCToolDigest.m; sourceTree = ""; }; 5DEB8F08074ED0200062A5DE /* BCToolComplement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCToolComplement.h; path = BCFoundation/BCTools/BCToolComplement.h; sourceTree = ""; }; 5DEB8F09074ED0200062A5DE /* BCToolComplement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCToolComplement.m; path = BCFoundation/BCTools/BCToolComplement.m; sourceTree = ""; }; 84476337070095540008A46C /* BCNucleotideRNA.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCNucleotideRNA.h; path = BCFoundation/BCSymbol/BCNucleotideRNA.h; sourceTree = ""; }; 84476338070095540008A46C /* BCNucleotideRNA.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCNucleotideRNA.m; path = BCFoundation/BCSymbol/BCNucleotideRNA.m; sourceTree = ""; }; 844A3E5E06D59FFA00423B33 /* BCAminoAcid.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCAminoAcid.h; path = BCFoundation/BCSymbol/BCAminoAcid.h; sourceTree = SOURCE_ROOT; }; 844A3E5F06D59FFA00423B33 /* BCAminoAcid.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCAminoAcid.m; path = BCFoundation/BCSymbol/BCAminoAcid.m; sourceTree = SOURCE_ROOT; }; 844A3E6006D59FFA00423B33 /* BCNucleotideDNA.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCNucleotideDNA.h; path = BCFoundation/BCSymbol/BCNucleotideDNA.h; sourceTree = SOURCE_ROOT; }; 844A3E6106D59FFA00423B33 /* BCNucleotideDNA.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCNucleotideDNA.m; path = BCFoundation/BCSymbol/BCNucleotideDNA.m; sourceTree = SOURCE_ROOT; }; 844A3E6206D59FFA00423B33 /* BCSymbol.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCSymbol.h; path = BCFoundation/BCSymbol/BCSymbol.h; sourceTree = SOURCE_ROOT; }; 844A3E6306D59FFA00423B33 /* BCSymbol.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCSymbol.m; path = BCFoundation/BCSymbol/BCSymbol.m; sourceTree = SOURCE_ROOT; }; 844A3E9406D5A16C00423B33 /* aminoacids.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; name = aminoacids.plist; path = BCFoundation/BCSymbol/SymbolTemplates/aminoacids.plist; sourceTree = ""; }; 844A3E9506D5A16C00423B33 /* nucleotides.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; name = nucleotides.plist; path = BCFoundation/BCSymbol/SymbolTemplates/nucleotides.plist; sourceTree = ""; }; 8499CF1D07CFE68B00E71F3B /* BCNucleotide.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCNucleotide.h; path = BCFoundation/BCSymbol/BCNucleotide.h; sourceTree = ""; }; 8499CF1E07CFE68B00E71F3B /* BCNucleotide.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCNucleotide.m; path = BCFoundation/BCSymbol/BCNucleotide.m; sourceTree = ""; }; 84D54ABB06DE346700B93E1D /* BCToolMassCalculator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCToolMassCalculator.h; path = BCFoundation/BCTools/BCToolMassCalculator.h; sourceTree = ""; }; 84D54ABC06DE346700B93E1D /* BCToolMassCalculator.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCToolMassCalculator.m; path = BCFoundation/BCTools/BCToolMassCalculator.m; sourceTree = ""; }; A62DB75707ED87FE006E8051 /* Readme.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Readme.txt; sourceTree = ""; }; A684951D06F48F6600C6DE25 /* BCFoundation.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCFoundation.h; path = BCFoundation/BCFoundation.h; sourceTree = ""; }; A684951E06F48F6600C6DE25 /* BCFoundationDefines.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCFoundationDefines.h; path = BCFoundation/BCFoundationDefines.h; sourceTree = ""; }; A69A394506F2388E00A82E04 /* BCSymbolSet.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCSymbolSet.m; path = BCFoundation/BCSymbol/BCSymbolSet.m; sourceTree = ""; }; A6B8D58206F22B1C00D408DE /* BCSymbolSet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCSymbolSet.h; path = BCFoundation/BCSymbol/BCSymbolSet.h; sourceTree = ""; }; A6BC0D8A07CB89970084DA38 /* BCAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCAnnotation.h; path = BCFoundation/BCSequence/BCAnnotation.h; sourceTree = ""; }; A6BC0D8B07CB89970084DA38 /* BCAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCAnnotation.m; path = BCFoundation/BCSequence/BCAnnotation.m; sourceTree = ""; }; D62419AC0CB6BB2F008005CC /* BCInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCInternal.h; path = BCFoundation/BCInternal.h; sourceTree = ""; }; D629C7160E86F2D100AB4448 /* BCFoundation.hdoc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = BCFoundation.hdoc; path = BCFoundation/BCFoundation.hdoc; sourceTree = ""; }; D64201330CA810C800946E18 /* TestBCSuffixArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestBCSuffixArray.h; path = "Tests/Test-BCFoundation/TestBCSuffixArray.h"; sourceTree = ""; }; D64201340CA810C800946E18 /* TestBCSuffixArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestBCSuffixArray.m; path = "Tests/Test-BCFoundation/TestBCSuffixArray.m"; sourceTree = ""; }; D642026D0CA9B78C00946E18 /* TestBCCachedSequenceFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestBCCachedSequenceFile.h; path = "Tests/Test-BCFoundation/TestBCCachedSequenceFile.h"; sourceTree = ""; }; D642026E0CA9B78C00946E18 /* TestBCCachedSequenceFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestBCCachedSequenceFile.m; path = "Tests/Test-BCFoundation/TestBCCachedSequenceFile.m"; sourceTree = ""; }; D642F95A0C95A71400946E18 /* BCCachedSequenceFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCCachedSequenceFile.h; path = BCFoundation/BCSequenceIO/BCCachedSequenceFile.h; sourceTree = ""; }; D642F95B0C95A71400946E18 /* BCCachedSequenceFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCCachedSequenceFile.m; path = BCFoundation/BCSequenceIO/BCCachedSequenceFile.m; sourceTree = ""; }; D642F9700C95A9F000946E18 /* BCCachedFastaFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCCachedFastaFile.h; path = BCFoundation/BCSequenceIO/BCCachedFastaFile.h; sourceTree = ""; }; D642F9710C95A9F000946E18 /* BCCachedFastaFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCCachedFastaFile.m; path = BCFoundation/BCSequenceIO/BCCachedFastaFile.m; sourceTree = ""; }; D642FDC40CA2BC5E00946E18 /* TestBCSequenceReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestBCSequenceReader.h; path = "Tests/Test-BCFoundation/TestBCSequenceReader.h"; sourceTree = ""; }; D642FDC50CA2BC5E00946E18 /* TestBCSequenceReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestBCSequenceReader.m; path = "Tests/Test-BCFoundation/TestBCSequenceReader.m"; sourceTree = ""; }; D642FE430CA2CC8600946E18 /* pBR322 */ = {isa = PBXFileReference; lastKnownFileType = file; name = pBR322; path = "Tests/Test-BCFoundation/DataFiles/pBR322"; sourceTree = ""; }; D642FE530CA2FC4B00946E18 /* UBBYB */ = {isa = PBXFileReference; explicitFileType = file; name = UBBYB; path = "Tests/Test-BCFoundation/DataFiles/UBBYB"; sourceTree = ""; }; D642FEA80CA4592000946E18 /* hB2AR-CDS.xdna */ = {isa = PBXFileReference; lastKnownFileType = file; name = "hB2AR-CDS.xdna"; path = "Tests/Test-BCFoundation/DataFiles/hB2AR-CDS.xdna"; sourceTree = ""; }; D642FEA90CA4592000946E18 /* hB2AR-protein.xprt */ = {isa = PBXFileReference; lastKnownFileType = file; name = "hB2AR-protein.xprt"; path = "Tests/Test-BCFoundation/DataFiles/hB2AR-protein.xprt"; sourceTree = ""; }; D642FEAA0CA4592000946E18 /* hB26H-N,S oligos */ = {isa = PBXFileReference; lastKnownFileType = file; name = "hB26H-N,S oligos"; path = "Tests/Test-BCFoundation/DataFiles/hB26H-N,S oligos"; sourceTree = ""; }; D642FEAB0CA4592000946E18 /* pCDNA3.xdna */ = {isa = PBXFileReference; lastKnownFileType = file; name = pCDNA3.xdna; path = "Tests/Test-BCFoundation/DataFiles/pCDNA3.xdna"; sourceTree = ""; }; D642FEAC0CA4592000946E18 /* pvL1392-SFhB26H */ = {isa = PBXFileReference; lastKnownFileType = file; name = "pvL1392-SFhB26H"; path = "Tests/Test-BCFoundation/DataFiles/pvL1392-SFhB26H"; sourceTree = ""; }; D642FF0B0CA45FF100946E18 /* test.fa */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = test.fa; path = "Tests/Test-BCFoundation/DataFiles/test.fa"; sourceTree = ""; }; D642FF0C0CA45FF100946E18 /* transposon.clustalw */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = transposon.clustalw; path = "Tests/Test-BCFoundation/DataFiles/transposon.clustalw"; sourceTree = ""; }; D642FF0D0CA45FF100946E18 /* transposon.fasta */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = transposon.fasta; path = "Tests/Test-BCFoundation/DataFiles/transposon.fasta"; sourceTree = ""; }; D65244740C67CE5C00045868 /* BCMCP.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCMCP.h; path = BCFoundation/BCAnalysis/BCMCP.h; sourceTree = ""; }; D65244750C67CE5C00045868 /* BCMCP.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCMCP.m; path = BCFoundation/BCAnalysis/BCMCP.m; sourceTree = ""; }; D65244760C67CE5C00045868 /* BCSuffixArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = BCSuffixArray.h; path = BCFoundation/BCAnalysis/BCSuffixArray.h; sourceTree = ""; }; D65244770C67CE5C00045868 /* BCSuffixArray.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = BCSuffixArray.m; path = BCFoundation/BCAnalysis/BCSuffixArray.m; sourceTree = ""; }; D673E7760E844C6500A17198 /* headerDoc2HTML.config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = headerDoc2HTML.config; path = Documentation/headerDoc2HTML.config; sourceTree = ""; }; D673E7770E844C6500A17198 /* headerdocBioCocoa.tmpl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = headerdocBioCocoa.tmpl; path = Documentation/headerdocBioCocoa.tmpl; sourceTree = ""; }; D689018C0D4FDA7D003DFAEE /* Publications.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Publications.txt; sourceTree = ""; wrapsLines = 0; }; D68E13E50EBE224E00B29CF3 /* Authors.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Authors.txt; sourceTree = ""; }; D69310500C511444001936CC /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = /System/Library/Frameworks/SenTestingKit.framework; sourceTree = ""; }; D696200C0E9BE16D008E791D /* BCGEODownloadController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCGEODownloadController.h; path = BCAppKit/BCGEODownloadController.h; sourceTree = ""; }; D696200D0E9BE16D008E791D /* BCGEODownloadController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCGEODownloadController.m; path = BCAppKit/BCGEODownloadController.m; sourceTree = ""; }; D696200E0E9BE16D008E791D /* BCSeriesTableController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCSeriesTableController.h; path = BCAppKit/BCSeriesTableController.h; sourceTree = ""; }; D696200F0E9BE16D008E791D /* BCSeriesTableController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCSeriesTableController.m; path = BCAppKit/BCSeriesTableController.m; sourceTree = ""; }; D69620170E9BE1C1008E791D /* BCGEODownload.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = BCGEODownload.nib; path = Resources/English.lproj/BCGEODownload.nib; sourceTree = ""; }; D69620190E9BE1C1008E791D /* BCPlatformTable.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = BCPlatformTable.nib; path = Resources/English.lproj/BCPlatformTable.nib; sourceTree = ""; }; D696201B0E9BE1C1008E791D /* BCProbeTable.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = BCProbeTable.nib; path = Resources/English.lproj/BCProbeTable.nib; sourceTree = ""; }; D696201D0E9BE1C1008E791D /* BCSampleTable.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = BCSampleTable.nib; path = Resources/English.lproj/BCSampleTable.nib; sourceTree = ""; }; D696201F0E9BE1C1008E791D /* BCSeriesTable.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = BCSeriesTable.nib; path = Resources/English.lproj/BCSeriesTable.nib; sourceTree = ""; }; D69620290E9BE3DE008E791D /* BCPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCPreferences.h; path = BCFoundation/BCPreferences.h; sourceTree = ""; }; D696202A0E9BE3DE008E791D /* BCPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCPreferences.m; path = BCFoundation/BCPreferences.m; sourceTree = ""; }; D69620350E9BE602008E791D /* BCParseSOFT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCParseSOFT.h; path = BCFoundation/BCGeneExpression/BCParseSOFT.h; sourceTree = ""; }; D69620360E9BE602008E791D /* BCParseSOFT.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCParseSOFT.m; path = BCFoundation/BCGeneExpression/BCParseSOFT.m; sourceTree = ""; }; D69620370E9BE602008E791D /* BCPlatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCPlatform.h; path = BCFoundation/BCGeneExpression/BCPlatform.h; sourceTree = ""; }; D69620380E9BE602008E791D /* BCPlatform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCPlatform.m; path = BCFoundation/BCGeneExpression/BCPlatform.m; sourceTree = ""; }; D69620390E9BE602008E791D /* BCSample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCSample.h; path = BCFoundation/BCGeneExpression/BCSample.h; sourceTree = ""; }; D696203A0E9BE602008E791D /* BCSample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCSample.m; path = BCFoundation/BCGeneExpression/BCSample.m; sourceTree = ""; }; D696203B0E9BE602008E791D /* BCSeries.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCSeries.h; path = BCFoundation/BCGeneExpression/BCSeries.h; sourceTree = ""; }; D696203C0E9BE602008E791D /* BCSeries.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCSeries.m; path = BCFoundation/BCGeneExpression/BCSeries.m; sourceTree = ""; }; D69620470E9BE613008E791D /* BCGeneExpressionOmnibus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCGeneExpressionOmnibus.h; path = BCFoundation/BCWebServices/BCGeneExpressionOmnibus.h; sourceTree = ""; }; D69620480E9BE613008E791D /* BCGeneExpressionOmnibus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCGeneExpressionOmnibus.m; path = BCFoundation/BCWebServices/BCGeneExpressionOmnibus.m; sourceTree = ""; }; D696204F0E9BE67A008E791D /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; D696205B0E9BE759008E791D /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = ""; }; D69620880E9BFA21008E791D /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = ""; }; D696213B0EA6A97E008E791D /* test.fastq */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = test.fastq; path = "Tests/Test-BCFoundation/DataFiles/test.fastq"; sourceTree = ""; }; D69621600EA8FB59008E791D /* BCDataMatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BCDataMatrix.h; path = BCFoundation/BCUtils/BCDataMatrix.h; sourceTree = ""; }; D69621610EA8FB59008E791D /* BCDataMatrix.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BCDataMatrix.m; path = BCFoundation/BCUtils/BCDataMatrix.m; sourceTree = ""; }; D69D050E10FFD0BE00F476C7 /* ChangeLog */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ChangeLog; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 4802008207D424F100D236DF /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 4802008307D424F100D236DF /* Cocoa.framework in Frameworks */, D69620500E9BE67A008E791D /* CoreServices.framework in Frameworks */, D696205C0E9BE759008E791D /* SystemConfiguration.framework in Frameworks */, D69620890E9BFA21008E791D /* WebKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 489E72A407D041B700CF2786 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 4818329307FFC4B800B42A19 /* BioCocoa.framework in Frameworks */, D69310650C511444001936CC /* SenTestingKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 0448156609BCC4DC00B8FA97 /* DeveloperDocs */ = { isa = PBXGroup; children = ( D69D050E10FFD0BE00F476C7 /* ChangeLog */, 0448156909BCC4DC00B8FA97 /* bc.css */, 0448156709BCC4DC00B8FA97 /* about-cvs.html */, 5D85BE7509D77D410059781C /* about-svn.html */, 0448156809BCC4DC00B8FA97 /* about-tests.html */, 0448156A09BCC4DC00B8FA97 /* biococoaxcode.html */, 0448156B09BCC4DC00B8FA97 /* headerdoc.html */, 0448156C09BCC4DC00B8FA97 /* index.html */, 0448156D09BCC4DC00B8FA97 /* newfiles.html */, 0448156E09BCC4DC00B8FA97 /* newtargets.html */, 0448156F09BCC4DC00B8FA97 /* todo.html */, ); path = DeveloperDocs; sourceTree = ""; }; 080E96DDFE201D6D7F000001 /* SequenceConverter */ = { isa = PBXGroup; children = ( A62DB64C07ED830B006E8051 /* Resources */, ); name = SequenceConverter; sourceTree = ""; }; 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( D69620880E9BFA21008E791D /* WebKit.framework */, D696205B0E9BE759008E791D /* SystemConfiguration.framework */, D696204F0E9BE67A008E791D /* CoreServices.framework */, D69310500C511444001936CC /* SenTestingKit.framework */, 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, ); name = "Linked Frameworks"; sourceTree = ""; }; 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { isa = PBXGroup; children = ( 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 29B97324FDCFA39411CA2CEA /* AppKit.framework */, ); name = "Other Frameworks"; sourceTree = ""; }; 19C28FACFE9D520D11CA2CBB /* Products */ = { isa = PBXGroup; children = ( 489E72A707D041B700CF2786 /* Test - BCFoundation.framework */, 4802008907D424F100D236DF /* BioCocoa.framework */, ); name = Products; sourceTree = ""; }; 29B97314FDCFA39411CA2CEA /* Xtract */ = { isa = PBXGroup; children = ( 0448156609BCC4DC00B8FA97 /* DeveloperDocs */, A6D52FB306F33CF300F51735 /* Documentation */, A6D52FB506F33D5000F51735 /* BCAppkit */, A6D52FB406F33D2F00F51735 /* BCFoundation */, 29B97317FDCFA39411CA2CEA /* Resources */, A69A38CF06F22D7400A82E04 /* Examples */, 48DCBB52081C627A00C222EA /* Tests */, A62DB74707ED8793006E8051 /* General Sources */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, ); name = Xtract; sourceTree = ""; }; 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( D69620160E9BE1C1008E791D /* BCGEODownload.nib */, D69620180E9BE1C1008E791D /* BCPlatformTable.nib */, D696201A0E9BE1C1008E791D /* BCProbeTable.nib */, D696201C0E9BE1C1008E791D /* BCSampleTable.nib */, D696201E0E9BE1C1008E791D /* BCSeriesTable.nib */, 0465452209BDCFCE00E7688D /* BC.icns */, 0448160209BDC4BC00B8FA97 /* Info-BioCocoa.plist */, ); name = Resources; sourceTree = ""; }; 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, ); name = Frameworks; sourceTree = ""; }; 48DCBB52081C627A00C222EA /* Tests */ = { isa = PBXGroup; children = ( 48DCBB55081C629800C222EA /* Test-BCFoundation */, ); name = Tests; sourceTree = ""; }; 48DCBB55081C629800C222EA /* Test-BCFoundation */ = { isa = PBXGroup; children = ( D642FDE80CA2C0D200946E18 /* Data Files */, 48DCBB5A081C62CB00C222EA /* Test-BCFoundation_Prefix.h */, 48DCBB5B081C62CC00C222EA /* Test-BCFoundation-Info.plist */, 48DCBB5E081C62CC00C222EA /* TestBCSequenceInit.h */, 48DCBB5F081C62CC00C222EA /* TestBCSequenceInit.m */, 48DCBB60081C62CC00C222EA /* TestBCSequenceProperties.h */, 48DCBB61081C62CC00C222EA /* TestBCSequenceProperties.m */, D642FDC40CA2BC5E00946E18 /* TestBCSequenceReader.h */, D642FDC50CA2BC5E00946E18 /* TestBCSequenceReader.m */, D64201330CA810C800946E18 /* TestBCSuffixArray.h */, D64201340CA810C800946E18 /* TestBCSuffixArray.m */, D642026D0CA9B78C00946E18 /* TestBCCachedSequenceFile.h */, D642026E0CA9B78C00946E18 /* TestBCCachedSequenceFile.m */, ); name = "Test-BCFoundation"; sourceTree = ""; }; 5D4CD6DD06BB117800CD5783 /* BCUtils */ = { isa = PBXGroup; children = ( D69621600EA8FB59008E791D /* BCDataMatrix.h */, D69621610EA8FB59008E791D /* BCDataMatrix.m */, 04C2DB28065A5ED50015C8C7 /* BCUtilStrings.h */, 04C2DB29065A5ED50015C8C7 /* BCUtilStrings.m */, 5D6F4F940891DE0B0072286F /* BCUtilData.h */, 5D6F4F950891DE0B0072286F /* BCUtilData.m */, ); name = BCUtils; sourceTree = ""; }; 5D81C606088DD07500DEB16C /* BCGeneticCode */ = { isa = PBXGroup; children = ( 5D81C607088DD07500DEB16C /* BCCodon.h */, 5D81C608088DD07500DEB16C /* BCCodon.m */, 5D81C609088DD07500DEB16C /* BCCodonDNA.h */, 5D81C60A088DD07500DEB16C /* BCCodonDNA.m */, 5D81C60B088DD07500DEB16C /* BCCodonRNA.h */, 5D81C60C088DD07500DEB16C /* BCCodonRNA.m */, 5D81C60D088DD07500DEB16C /* BCGeneticCode.h */, 5D81C60E088DD07500DEB16C /* BCGeneticCode.m */, 5D81C60F088DD07500DEB16C /* Genetic Codes */, ); name = BCGeneticCode; path = BCFoundation/BCGeneticCode; sourceTree = ""; }; 5D81C60F088DD07500DEB16C /* Genetic Codes */ = { isa = PBXGroup; children = ( 5D81C610088DD07500DEB16C /* universal genetic code.plist */, 5D81C611088DD07500DEB16C /* vertebrate mitochondrial genetic code.plist */, ); path = "Genetic Codes"; sourceTree = ""; }; 5D81C748088DED8E00DEB16C /* BCProteinStructure */ = { isa = PBXGroup; children = ( 5D81C775088DEFFD00DEB16C /* BCSecondaryStructure.h */, 5D81C776088DEFFD00DEB16C /* BCSecondaryStructure.m */, 5D81C749088DED8E00DEB16C /* BCAtom.h */, 5D81C74A088DED8E00DEB16C /* BCAtom.m */, 5D81C74B088DED8E00DEB16C /* BCChain.h */, 5D81C74C088DED8E00DEB16C /* BCChain.m */, 5D81C74D088DED8E00DEB16C /* BCProteinStructure.h */, 5D81C74E088DED8E00DEB16C /* BCProteinStructure.m */, 5D81C74F088DED8E00DEB16C /* BCResidue.h */, 5D81C750088DED8E00DEB16C /* BCResidue.m */, 5D81C753088DED8E00DEB16C /* BCSequenceStructure.h */, 5D81C754088DED8E00DEB16C /* BCSequenceStructure.m */, ); name = BCProteinStructure; path = BCFoundation/BCProteinStructure; sourceTree = ""; }; 5D81C7B2088DF07600DEB16C /* BCAlignment */ = { isa = PBXGroup; children = ( 5D81C7B3088DF07600DEB16C /* BCPairwiseAlignment.h */, 5D81C7B4088DF07600DEB16C /* BCPairwiseAlignment.m */, 5D81C7B5088DF07600DEB16C /* BCScoreMatrix.h */, 5D81C7B6088DF07600DEB16C /* BCScoreMatrix.m */, 5D81C7B7088DF07600DEB16C /* BCSequenceAlignment.h */, 5D81C7B8088DF07600DEB16C /* BCSequenceAlignment.m */, ); name = BCAlignment; path = BCFoundation/BCAlignment; sourceTree = ""; }; 8407370906DEC0450067BC1C /* Translation */ = { isa = PBXGroup; children = ( A62DB64B07ED82E6006E8051 /* Resources */, ); name = Translation; sourceTree = ""; }; 844A3E4B06D59FB600423B33 /* BCSequence */ = { isa = PBXGroup; children = ( 5D81C63F088DD28600DEB16C /* BCSequenceCodon.h */, 5D81C640088DD28600DEB16C /* BCSequenceCodon.m */, 4897A0F807B34C960024883E /* BCSequence.h */, 4897A0F907B34C960024883E /* BCSequence.m */, A6BC0D8A07CB89970084DA38 /* BCAnnotation.h */, A6BC0D8B07CB89970084DA38 /* BCAnnotation.m */, 5DB533F308F945970043BAC3 /* BCSequenceArray.h */, 5DB533F408F945970043BAC3 /* BCSequenceArray.m */, ); name = BCSequence; sourceTree = ""; }; 844A3E5906D59FE500423B33 /* BCSymbol */ = { isa = PBXGroup; children = ( 844A3E5E06D59FFA00423B33 /* BCAminoAcid.h */, 844A3E5F06D59FFA00423B33 /* BCAminoAcid.m */, 8499CF1D07CFE68B00E71F3B /* BCNucleotide.h */, 8499CF1E07CFE68B00E71F3B /* BCNucleotide.m */, 844A3E6006D59FFA00423B33 /* BCNucleotideDNA.h */, 844A3E6106D59FFA00423B33 /* BCNucleotideDNA.m */, 84476337070095540008A46C /* BCNucleotideRNA.h */, 84476338070095540008A46C /* BCNucleotideRNA.m */, 844A3E6206D59FFA00423B33 /* BCSymbol.h */, 844A3E6306D59FFA00423B33 /* BCSymbol.m */, A6B8D58206F22B1C00D408DE /* BCSymbolSet.h */, A69A394506F2388E00A82E04 /* BCSymbolSet.m */, A6A2293106F23B91007B48B2 /* Symbol Templates */, ); name = BCSymbol; sourceTree = ""; }; A62DB61207ED80ED006E8051 /* Peptides */ = { isa = PBXGroup; children = ( A62DB64A07ED82BA006E8051 /* Resources */, ); name = Peptides; sourceTree = ""; }; A62DB64A07ED82BA006E8051 /* Resources */ = { isa = PBXGroup; children = ( ); name = Resources; sourceTree = ""; }; A62DB64B07ED82E6006E8051 /* Resources */ = { isa = PBXGroup; children = ( ); name = Resources; sourceTree = ""; }; A62DB64C07ED830B006E8051 /* Resources */ = { isa = PBXGroup; children = ( 049D0E10054ED30C00000102 /* BC.icns */, ); name = Resources; sourceTree = ""; }; A62DB74707ED8793006E8051 /* General Sources */ = { isa = PBXGroup; children = ( 04C2DB26065A5ED50015C8C7 /* BioCocoa_Prefix.h */, 04C2DB27065A5ED50015C8C7 /* main.c */, ); name = "General Sources"; sourceTree = ""; }; A688523606F39B5B00F25A36 /* BCTools */ = { isa = PBXGroup; children = ( 5D81C622088DD14A00DEB16C /* BCToolTranslator.h */, 5D81C623088DD14A00DEB16C /* BCToolTranslator.m */, 5D81C624088DD14A00DEB16C /* BCToolTranslatorDNA.h */, 5D81C625088DD14A00DEB16C /* BCToolTranslatorDNA.m */, 5DEB8F08074ED0200062A5DE /* BCToolComplement.h */, 5DEB8F09074ED0200062A5DE /* BCToolComplement.m */, 5DA65F150731CE1000E4B0D9 /* BCToolSequenceFinder.h */, 5DA65F160731CE1000E4B0D9 /* BCToolSequenceFinder.m */, 5D583D92073087E4004AB031 /* BCToolSymbolCounter.h */, 5D583D93073087E4004AB031 /* BCToolSymbolCounter.m */, 5D27F9AC0823B4AE0008A8CA /* BCToolHydropathyCalculator.h */, 5D27F9AD0823B4AE0008A8CA /* BCToolHydropathyCalculator.m */, 84D54ABB06DE346700B93E1D /* BCToolMassCalculator.h */, 84D54ABC06DE346700B93E1D /* BCToolMassCalculator.m */, 5DD2B45D07D17C9D000436B2 /* BCToolDigest.h */, 5DD2B45E07D17C9D000436B2 /* BCToolDigest.m */, 5D6B438D0773BBE80020682B /* BCSequenceTool.h */, 5D6B438E0773BBE80020682B /* BCSequenceTool.m */, ); name = BCTools; sourceTree = ""; }; A69A38CF06F22D7400A82E04 /* Examples */ = { isa = PBXGroup; children = ( A62DB61207ED80ED006E8051 /* Peptides */, 8407370906DEC0450067BC1C /* Translation */, 080E96DDFE201D6D7F000001 /* SequenceConverter */, ); name = Examples; sourceTree = ""; }; A6A2293106F23B91007B48B2 /* Symbol Templates */ = { isa = PBXGroup; children = ( 844A3E9406D5A16C00423B33 /* aminoacids.plist */, 844A3E9506D5A16C00423B33 /* nucleotides.plist */, ); name = "Symbol Templates"; sourceTree = ""; }; A6B8D58606F22C7100D408DE /* BCSequenceIO */ = { isa = PBXGroup; children = ( 5DC52C890741A9A000E772AB /* BCSequenceReader.h */, 5DC52C8A0741A9A000E772AB /* BCSequenceReader.m */, 5D6D40920A8E1FEC00147C25 /* BCSequenceWriter.h */, 5D6D40930A8E1FEC00147C25 /* BCSequenceWriter.m */, D642F95A0C95A71400946E18 /* BCCachedSequenceFile.h */, D642F95B0C95A71400946E18 /* BCCachedSequenceFile.m */, D642F9700C95A9F000946E18 /* BCCachedFastaFile.h */, D642F9710C95A9F000946E18 /* BCCachedFastaFile.m */, ); name = BCSequenceIO; sourceTree = ""; }; A6D52FB306F33CF300F51735 /* Documentation */ = { isa = PBXGroup; children = ( D629C7160E86F2D100AB4448 /* BCFoundation.hdoc */, D673E7760E844C6500A17198 /* headerDoc2HTML.config */, D673E7770E844C6500A17198 /* headerdocBioCocoa.tmpl */, A62DB75707ED87FE006E8051 /* Readme.txt */, 5D85F85F0A72612300FD7194 /* license.txt */, D689018C0D4FDA7D003DFAEE /* Publications.txt */, D68E13E50EBE224E00B29CF3 /* Authors.txt */, ); name = Documentation; sourceTree = ""; }; A6D52FB406F33D2F00F51735 /* BCFoundation */ = { isa = PBXGroup; children = ( D69620320E9BE5E1008E791D /* BCGeneExpression */, D696202F0E9BE5D7008E791D /* BCWebServices */, D69620290E9BE3DE008E791D /* BCPreferences.h */, D696202A0E9BE3DE008E791D /* BCPreferences.m */, D62419AC0CB6BB2F008005CC /* BCInternal.h */, 0448162D09BDC6A100B8FA97 /* BCStringDefinitions.h */, 0448162E09BDC6A100B8FA97 /* BCStringDefinitions.m */, A684951D06F48F6600C6DE25 /* BCFoundation.h */, A684951E06F48F6600C6DE25 /* BCFoundationDefines.h */, 5D81C7B2088DF07600DEB16C /* BCAlignment */, D652446B0C67CC9500045868 /* BCAnalysis */, 5D81C606088DD07500DEB16C /* BCGeneticCode */, 5D81C748088DED8E00DEB16C /* BCProteinStructure */, 844A3E4B06D59FB600423B33 /* BCSequence */, A6B8D58606F22C7100D408DE /* BCSequenceIO */, 844A3E5906D59FE500423B33 /* BCSymbol */, A688523606F39B5B00F25A36 /* BCTools */, 5D4CD6DD06BB117800CD5783 /* BCUtils */, ); name = BCFoundation; sourceTree = ""; }; A6D52FB506F33D5000F51735 /* BCAppkit */ = { isa = PBXGroup; children = ( D696200C0E9BE16D008E791D /* BCGEODownloadController.h */, D696200D0E9BE16D008E791D /* BCGEODownloadController.m */, D696200E0E9BE16D008E791D /* BCSeriesTableController.h */, D696200F0E9BE16D008E791D /* BCSeriesTableController.m */, 5D4F377D07CEC219004B7241 /* BCAppKit.h */, 5DB9BD7A07D5488500B4C5E3 /* BCAppKitDefines.h */, 5D5A0B3607CC19D900578AA1 /* BCSequenceView.h */, 5D5A0B3707CC19D900578AA1 /* BCSequenceView.m */, ); name = BCAppkit; sourceTree = ""; }; D642FDE80CA2C0D200946E18 /* Data Files */ = { isa = PBXGroup; children = ( D642FF0B0CA45FF100946E18 /* test.fa */, D642FF0C0CA45FF100946E18 /* transposon.clustalw */, D642FF0D0CA45FF100946E18 /* transposon.fasta */, D642FEA80CA4592000946E18 /* hB2AR-CDS.xdna */, D642FEA90CA4592000946E18 /* hB2AR-protein.xprt */, D642FEAA0CA4592000946E18 /* hB26H-N,S oligos */, D642FEAB0CA4592000946E18 /* pCDNA3.xdna */, D642FEAC0CA4592000946E18 /* pvL1392-SFhB26H */, D642FE530CA2FC4B00946E18 /* UBBYB */, D642FE430CA2CC8600946E18 /* pBR322 */, D696213B0EA6A97E008E791D /* test.fastq */, ); name = "Data Files"; sourceTree = ""; }; D652446B0C67CC9500045868 /* BCAnalysis */ = { isa = PBXGroup; children = ( D65244740C67CE5C00045868 /* BCMCP.h */, D65244750C67CE5C00045868 /* BCMCP.m */, D65244760C67CE5C00045868 /* BCSuffixArray.h */, D65244770C67CE5C00045868 /* BCSuffixArray.m */, ); name = BCAnalysis; sourceTree = ""; }; D696202F0E9BE5D7008E791D /* BCWebServices */ = { isa = PBXGroup; children = ( D69620470E9BE613008E791D /* BCGeneExpressionOmnibus.h */, D69620480E9BE613008E791D /* BCGeneExpressionOmnibus.m */, ); name = BCWebServices; sourceTree = ""; }; D69620320E9BE5E1008E791D /* BCGeneExpression */ = { isa = PBXGroup; children = ( D69620350E9BE602008E791D /* BCParseSOFT.h */, D69620360E9BE602008E791D /* BCParseSOFT.m */, D69620370E9BE602008E791D /* BCPlatform.h */, D69620380E9BE602008E791D /* BCPlatform.m */, D69620390E9BE602008E791D /* BCSample.h */, D696203A0E9BE602008E791D /* BCSample.m */, D696203B0E9BE602008E791D /* BCSeries.h */, D696203C0E9BE602008E791D /* BCSeries.m */, ); name = BCGeneExpression; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 4802002F07D424F100D236DF /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 0448162F09BDC6A100B8FA97 /* BCStringDefinitions.h in Headers */, 4802003007D424F100D236DF /* BCSequence.h in Headers */, 4802003307D424F100D236DF /* BioCocoa_Prefix.h in Headers */, 4802003407D424F100D236DF /* BCUtilStrings.h in Headers */, 4802003907D424F100D236DF /* BCAminoAcid.h in Headers */, 4802003A07D424F100D236DF /* BCNucleotideDNA.h in Headers */, 4802003B07D424F100D236DF /* BCSymbol.h in Headers */, 4802003C07D424F100D236DF /* BCToolMassCalculator.h in Headers */, 4802004107D424F100D236DF /* BCSymbolSet.h in Headers */, 4802004307D424F100D236DF /* BCFoundation.h in Headers */, 4802004407D424F100D236DF /* BCFoundationDefines.h in Headers */, 4802004507D424F100D236DF /* BCNucleotideRNA.h in Headers */, 4802004B07D424F100D236DF /* BCToolSymbolCounter.h in Headers */, 4802004C07D424F100D236DF /* BCToolSequenceFinder.h in Headers */, 4802004D07D424F100D236DF /* BCSequenceReader.h in Headers */, 4802004E07D424F100D236DF /* BCToolComplement.h in Headers */, 4802004F07D424F100D236DF /* BCSequenceTool.h in Headers */, 4802005007D424F100D236DF /* BCAnnotation.h in Headers */, 4802005107D424F100D236DF /* BCSequenceView.h in Headers */, 4802005207D424F100D236DF /* BCAppKit.h in Headers */, 4802005407D424F100D236DF /* BCNucleotide.h in Headers */, 4802005507D424F100D236DF /* BCToolDigest.h in Headers */, 5DB9BD7B07D5488500B4C5E3 /* BCAppKitDefines.h in Headers */, 5D27F9AE0823B4AE0008A8CA /* BCToolHydropathyCalculator.h in Headers */, 5D81C612088DD07500DEB16C /* BCCodon.h in Headers */, 5D81C614088DD07500DEB16C /* BCCodonDNA.h in Headers */, 5D81C616088DD07500DEB16C /* BCCodonRNA.h in Headers */, 5D81C618088DD07500DEB16C /* BCGeneticCode.h in Headers */, 5D81C626088DD14A00DEB16C /* BCToolTranslator.h in Headers */, 5D81C628088DD14A00DEB16C /* BCToolTranslatorDNA.h in Headers */, 5D81C641088DD28600DEB16C /* BCSequenceCodon.h in Headers */, 5D81C755088DED8E00DEB16C /* BCAtom.h in Headers */, 5D81C757088DED8E00DEB16C /* BCChain.h in Headers */, 5D81C759088DED8E00DEB16C /* BCProteinStructure.h in Headers */, 5D81C75B088DED8E00DEB16C /* BCResidue.h in Headers */, 5D81C75F088DED8E00DEB16C /* BCSequenceStructure.h in Headers */, 5D81C777088DEFFD00DEB16C /* BCSecondaryStructure.h in Headers */, 5D81C7B9088DF07600DEB16C /* BCPairwiseAlignment.h in Headers */, 5D81C7BB088DF07600DEB16C /* BCScoreMatrix.h in Headers */, 5D81C7BD088DF07600DEB16C /* BCSequenceAlignment.h in Headers */, 5D6F4F960891DE0B0072286F /* BCUtilData.h in Headers */, 5DB533F508F945970043BAC3 /* BCSequenceArray.h in Headers */, 5D6D40940A8E1FEC00147C25 /* BCSequenceWriter.h in Headers */, D65244780C67CE5C00045868 /* BCMCP.h in Headers */, D652447A0C67CE5C00045868 /* BCSuffixArray.h in Headers */, D642F95C0C95A71400946E18 /* BCCachedSequenceFile.h in Headers */, D642F9720C95A9F000946E18 /* BCCachedFastaFile.h in Headers */, D62419AD0CB6BB2F008005CC /* BCInternal.h in Headers */, D69620100E9BE16D008E791D /* BCGEODownloadController.h in Headers */, D69620120E9BE16D008E791D /* BCSeriesTableController.h in Headers */, D696202B0E9BE3DE008E791D /* BCPreferences.h in Headers */, D696203D0E9BE602008E791D /* BCParseSOFT.h in Headers */, D696203F0E9BE602008E791D /* BCPlatform.h in Headers */, D69620410E9BE602008E791D /* BCSample.h in Headers */, D69620430E9BE602008E791D /* BCSeries.h in Headers */, D69620490E9BE613008E791D /* BCGeneExpressionOmnibus.h in Headers */, D69621620EA8FB59008E791D /* BCDataMatrix.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; 489E72A107D041B700CF2786 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 48DCBB66081C62CC00C222EA /* Test-BCFoundation_Prefix.h in Headers */, 48DCBB6A081C62CC00C222EA /* TestBCSequenceInit.h in Headers */, 48DCBB6C081C62CC00C222EA /* TestBCSequenceProperties.h in Headers */, D642FDC60CA2BC5E00946E18 /* TestBCSequenceReader.h in Headers */, D64201350CA810C800946E18 /* TestBCSuffixArray.h in Headers */, D642026F0CA9B78C00946E18 /* TestBCCachedSequenceFile.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 4802002E07D424F100D236DF /* BioCocoa */ = { isa = PBXNativeTarget; buildConfigurationList = 5DC80DE608835914008257D8 /* Build configuration list for PBXNativeTarget "BioCocoa" */; buildPhases = ( 4802002F07D424F100D236DF /* Headers */, 4802005707D424F100D236DF /* Resources */, 4802005D07D424F100D236DF /* Sources */, 4802008207D424F100D236DF /* Frameworks */, 4802008407D424F100D236DF /* Rez */, ); buildRules = ( ); dependencies = ( ); name = BioCocoa; productInstallPath = "@executable_path/../Frameworks"; productName = BioCocoa; productReference = 4802008907D424F100D236DF /* BioCocoa.framework */; productType = "com.apple.product-type.framework"; }; 489E72A607D041B700CF2786 /* Test - BCFoundation */ = { isa = PBXNativeTarget; buildConfigurationList = 5DC80DEA08835914008257D8 /* Build configuration list for PBXNativeTarget "Test - BCFoundation" */; buildPhases = ( 489E72A107D041B700CF2786 /* Headers */, 489E72A207D041B700CF2786 /* Resources */, 489E72A307D041B700CF2786 /* Sources */, 489E72A407D041B700CF2786 /* Frameworks */, 489E72A507D041B700CF2786 /* ShellScript */, ); buildRules = ( ); dependencies = ( 481832F307FFCA5B00B42A19 /* PBXTargetDependency */, ); name = "Test - BCFoundation"; productName = "BCFoundation-Tests"; productReference = 489E72A707D041B700CF2786 /* Test - BCFoundation.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { ORGANIZATIONNAME = "The BioCocoa Project"; }; buildConfigurationList = 5DC80DFA08835914008257D8 /* Build configuration list for PBXProject "BioCocoa" */; compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; mainGroup = 29B97314FDCFA39411CA2CEA /* Xtract */; projectDirPath = ""; projectRoot = ""; targets = ( 4802002E07D424F100D236DF /* BioCocoa */, 489E72A607D041B700CF2786 /* Test - BCFoundation */, D6CCD06D0EC0E0F60073F096 /* Documentation */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 4802005707D424F100D236DF /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 4802005807D424F100D236DF /* aminoacids.plist in Resources */, 4802005907D424F100D236DF /* nucleotides.plist in Resources */, 5D81C61A088DD07500DEB16C /* universal genetic code.plist in Resources */, 5D81C61B088DD07500DEB16C /* vertebrate mitochondrial genetic code.plist in Resources */, 0448157009BCC4DC00B8FA97 /* about-cvs.html in Resources */, 0448157109BCC4DC00B8FA97 /* about-tests.html in Resources */, 0448157209BCC4DC00B8FA97 /* bc.css in Resources */, 0448157309BCC4DC00B8FA97 /* biococoaxcode.html in Resources */, 0448157409BCC4DC00B8FA97 /* headerdoc.html in Resources */, 0448157509BCC4DC00B8FA97 /* index.html in Resources */, 0448157609BCC4DC00B8FA97 /* newfiles.html in Resources */, 0448157709BCC4DC00B8FA97 /* newtargets.html in Resources */, 0448157809BCC4DC00B8FA97 /* todo.html in Resources */, 0465452309BDCFCE00E7688D /* BC.icns in Resources */, D689018D0D4FDA7D003DFAEE /* Publications.txt in Resources */, D69620200E9BE1C1008E791D /* BCGEODownload.nib in Resources */, D69620210E9BE1C1008E791D /* BCPlatformTable.nib in Resources */, D69620220E9BE1C1008E791D /* BCProbeTable.nib in Resources */, D69620230E9BE1C1008E791D /* BCSampleTable.nib in Resources */, D69620240E9BE1C1008E791D /* BCSeriesTable.nib in Resources */, D68E13E60EBE224E00B29CF3 /* Authors.txt in Resources */, D69D050F10FFD0BE00F476C7 /* ChangeLog in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; 489E72A207D041B700CF2786 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 5D85BE7609D77D420059781C /* about-svn.html in Resources */, D642FE440CA2CC8600946E18 /* pBR322 in Resources */, D642FE540CA2FC4B00946E18 /* UBBYB in Resources */, D642FEAD0CA4592000946E18 /* hB2AR-CDS.xdna in Resources */, D642FEAE0CA4592000946E18 /* hB2AR-protein.xprt in Resources */, D642FEAF0CA4592000946E18 /* hB26H-N,S oligos in Resources */, D642FEB00CA4592000946E18 /* pCDNA3.xdna in Resources */, D642FEB10CA4592000946E18 /* pvL1392-SFhB26H in Resources */, D642FF0E0CA45FF100946E18 /* test.fa in Resources */, D642FF0F0CA45FF100946E18 /* transposon.clustalw in Resources */, D642FF100CA45FF100946E18 /* transposon.fasta in Resources */, D696213C0EA6A97E008E791D /* test.fastq in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXRezBuildPhase section */ 4802008407D424F100D236DF /* Rez */ = { isa = PBXRezBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXRezBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 489E72A507D041B700CF2786 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = /Developer/Tools/RunTargetUnitTests; }; D6CCD06C0EC0E0F60073F096 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; shellScript = "#! /bin/bash\n\n# build documentation\ncd Documentation\n\nrm -rf BCFoundation\nheaderdoc2html -o BCFoundation ../BCFoundation\ngatherheaderdoc BCFoundation\n"; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 4802005D07D424F100D236DF /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 4802006007D424F100D236DF /* BCUtilStrings.m in Sources */, 4802006107D424F100D236DF /* main.c in Sources */, 4802006507D424F100D236DF /* BCAminoAcid.m in Sources */, 4802006607D424F100D236DF /* BCNucleotideDNA.m in Sources */, 4802006707D424F100D236DF /* BCSymbol.m in Sources */, 4802006807D424F100D236DF /* BCToolMassCalculator.m in Sources */, 4802006E07D424F100D236DF /* BCSymbolSet.m in Sources */, 4802006F07D424F100D236DF /* BCNucleotideRNA.m in Sources */, 4802007507D424F100D236DF /* BCToolSymbolCounter.m in Sources */, 4802007607D424F100D236DF /* BCToolSequenceFinder.m in Sources */, 4802007707D424F100D236DF /* BCSequenceReader.m in Sources */, 4802007807D424F100D236DF /* BCToolComplement.m in Sources */, 4802007907D424F100D236DF /* BCSequenceTool.m in Sources */, 4802007A07D424F100D236DF /* BCSequence.m in Sources */, 4802007C07D424F100D236DF /* BCAnnotation.m in Sources */, 4802007D07D424F100D236DF /* BCSequenceView.m in Sources */, 4802007F07D424F100D236DF /* BCNucleotide.m in Sources */, 4802008007D424F100D236DF /* BCToolDigest.m in Sources */, 5D27F9AF0823B4AE0008A8CA /* BCToolHydropathyCalculator.m in Sources */, 5D81C613088DD07500DEB16C /* BCCodon.m in Sources */, 5D81C615088DD07500DEB16C /* BCCodonDNA.m in Sources */, 5D81C617088DD07500DEB16C /* BCCodonRNA.m in Sources */, 5D81C619088DD07500DEB16C /* BCGeneticCode.m in Sources */, 5D81C627088DD14A00DEB16C /* BCToolTranslator.m in Sources */, 5D81C629088DD14A00DEB16C /* BCToolTranslatorDNA.m in Sources */, 5D81C642088DD28600DEB16C /* BCSequenceCodon.m in Sources */, 5D81C756088DED8E00DEB16C /* BCAtom.m in Sources */, 5D81C758088DED8E00DEB16C /* BCChain.m in Sources */, 5D81C75A088DED8E00DEB16C /* BCProteinStructure.m in Sources */, 5D81C75C088DED8E00DEB16C /* BCResidue.m in Sources */, 5D81C760088DED8E00DEB16C /* BCSequenceStructure.m in Sources */, 5D81C778088DEFFD00DEB16C /* BCSecondaryStructure.m in Sources */, 5D81C7BA088DF07600DEB16C /* BCPairwiseAlignment.m in Sources */, 5D81C7BC088DF07600DEB16C /* BCScoreMatrix.m in Sources */, 5D81C7BE088DF07700DEB16C /* BCSequenceAlignment.m in Sources */, 5D6F4F970891DE0B0072286F /* BCUtilData.m in Sources */, 5DB533F608F945970043BAC3 /* BCSequenceArray.m in Sources */, 0448163009BDC6A100B8FA97 /* BCStringDefinitions.m in Sources */, 5D6D40950A8E1FEC00147C25 /* BCSequenceWriter.m in Sources */, D65244790C67CE5C00045868 /* BCMCP.m in Sources */, D652447B0C67CE5C00045868 /* BCSuffixArray.m in Sources */, D642F95D0C95A71400946E18 /* BCCachedSequenceFile.m in Sources */, D642F9730C95A9F000946E18 /* BCCachedFastaFile.m in Sources */, D69620110E9BE16D008E791D /* BCGEODownloadController.m in Sources */, D69620130E9BE16D008E791D /* BCSeriesTableController.m in Sources */, D696202C0E9BE3DE008E791D /* BCPreferences.m in Sources */, D696203E0E9BE602008E791D /* BCParseSOFT.m in Sources */, D69620400E9BE602008E791D /* BCPlatform.m in Sources */, D69620420E9BE602008E791D /* BCSample.m in Sources */, D69620440E9BE602008E791D /* BCSeries.m in Sources */, D696204A0E9BE613008E791D /* BCGeneExpressionOmnibus.m in Sources */, D69621630EA8FB59008E791D /* BCDataMatrix.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 489E72A307D041B700CF2786 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 48DCBB6B081C62CC00C222EA /* TestBCSequenceInit.m in Sources */, 48DCBB6D081C62CC00C222EA /* TestBCSequenceProperties.m in Sources */, D642FDC70CA2BC5E00946E18 /* TestBCSequenceReader.m in Sources */, D64201360CA810C800946E18 /* TestBCSuffixArray.m in Sources */, D64202700CA9B78C00946E18 /* TestBCCachedSequenceFile.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 481832F307FFCA5B00B42A19 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 4802002E07D424F100D236DF /* BioCocoa */; targetProxy = 481832F207FFCA5B00B42A19 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ D69620160E9BE1C1008E791D /* BCGEODownload.nib */ = { isa = PBXVariantGroup; children = ( D69620170E9BE1C1008E791D /* BCGEODownload.nib */, ); name = BCGEODownload.nib; sourceTree = ""; }; D69620180E9BE1C1008E791D /* BCPlatformTable.nib */ = { isa = PBXVariantGroup; children = ( D69620190E9BE1C1008E791D /* BCPlatformTable.nib */, ); name = BCPlatformTable.nib; sourceTree = ""; }; D696201A0E9BE1C1008E791D /* BCProbeTable.nib */ = { isa = PBXVariantGroup; children = ( D696201B0E9BE1C1008E791D /* BCProbeTable.nib */, ); name = BCProbeTable.nib; sourceTree = ""; }; D696201C0E9BE1C1008E791D /* BCSampleTable.nib */ = { isa = PBXVariantGroup; children = ( D696201D0E9BE1C1008E791D /* BCSampleTable.nib */, ); name = BCSampleTable.nib; sourceTree = ""; }; D696201E0E9BE1C1008E791D /* BCSeriesTable.nib */ = { isa = PBXVariantGroup; children = ( D696201F0E9BE1C1008E791D /* BCSeriesTable.nib */, ); name = BCSeriesTable.nib; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 5DC80DE708835914008257D8 /* Development */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ""; FRAMEWORK_VERSION = A; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = BioCocoa_Prefix.h; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "Resources/Info-BioCocoa.plist"; INSTALL_PATH = "@executable_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ""; MACOSX_DEPLOYMENT_TARGET = ""; OTHER_LDFLAGS = ( "-seg1addr", 0x10000000, ); PREBINDING = NO; PRODUCT_NAME = BioCocoa; SDKROOT = ""; SECTORDER_FLAGS = ""; WARNING_CFLAGS = ( "-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", ); WRAPPER_EXTENSION = framework; ZERO_LINK = NO; }; name = Development; }; 5DC80DE808835914008257D8 /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ""; FRAMEWORK_VERSION = A; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = BioCocoa_Prefix.h; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "Resources/Info-BioCocoa.plist"; INSTALL_PATH = "@executable_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ""; MACOSX_DEPLOYMENT_TARGET = ""; OTHER_LDFLAGS = ( "-seg1addr", 0x10000000, ); PREBINDING = NO; PRODUCT_NAME = BioCocoa; SDKROOT = ""; SECTORDER_FLAGS = ""; WARNING_CFLAGS = ( "-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", ); WRAPPER_EXTENSION = framework; ZERO_LINK = NO; }; name = Deployment; }; 5DC80DE908835914008257D8 /* Default */ = { isa = XCBuildConfiguration; buildSettings = { DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ""; FRAMEWORK_VERSION = A; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = BioCocoa_Prefix.h; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "Info-BioCocoa.plist"; INSTALL_PATH = "@executable_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ""; MACOSX_DEPLOYMENT_TARGET = ""; OTHER_LDFLAGS = ( "-seg1addr", 0x10000000, ); PREBINDING = NO; PRODUCT_NAME = BioCocoa; SDKROOT = ""; SECTORDER_FLAGS = ""; WARNING_CFLAGS = ( "-Wmost", "-Wno-four-char-constants", "-Wno-unknown-pragmas", ); WRAPPER_EXTENSION = framework; ZERO_LINK = NO; }; name = Default; }; 5DC80DEB08835914008257D8 /* Development */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( /Library/Frameworks, /System/Library/Frameworks, "$(DEVELOPER_FRAMEWORKS_DIR_QUOTED)", ); FRAMEWORK_VERSION = A; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Tests/Test-BCFoundation/Test-BCFoundation_Prefix.h"; GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; GCC_WARN_UNKNOWN_PRAGMAS = NO; INFOPLIST_FILE = "Tests/Test-BCFoundation/Test-BCFoundation-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; MACOSX_DEPLOYMENT_TARGET = ""; OTHER_CFLAGS = "-fobjc-exceptions"; OTHER_LDFLAGS = ( "-framework", Foundation, "-framework", AppKit, "-framework", SenTestingKit, ); OTHER_REZFLAGS = ""; PREBINDING = NO; PRODUCT_NAME = "Test - BCFoundation"; SDKROOT = ""; SECTORDER_FLAGS = ""; TEST_AFTER_BUILD = YES; WARNING_CFLAGS = "-Wmost"; ZERO_LINK = YES; }; name = Development; }; 5DC80DEC08835914008257D8 /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( /Library/Frameworks, "$(DEVELOPER_FRAMEWORKS_DIR_QUOTED)", ); FRAMEWORK_VERSION = A; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Tests/Test-BCFoundation/Test-BCFoundation_Prefix.h"; GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; GCC_WARN_UNKNOWN_PRAGMAS = NO; INFOPLIST_FILE = "Tests/Test-BCFoundation/Test-BCFoundation-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; MACOSX_DEPLOYMENT_TARGET = ""; OTHER_CFLAGS = "-fobjc-exceptions"; OTHER_LDFLAGS = ( "-framework", Foundation, "-framework", AppKit, "-framework", SenTestingKit, ); OTHER_REZFLAGS = ""; PREBINDING = NO; PRODUCT_NAME = "Test - BCFoundation"; SECTORDER_FLAGS = ""; TEST_AFTER_BUILD = YES; WARNING_CFLAGS = "-Wmost"; ZERO_LINK = NO; }; name = Deployment; }; 5DC80DED08835914008257D8 /* Default */ = { isa = XCBuildConfiguration; buildSettings = { DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ( /Library/Frameworks, "$(DEVELOPER_FRAMEWORKS_DIR_QUOTED)", ); FRAMEWORK_VERSION = A; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Tests/Test-BCFoundation/Test-BCFoundation_Prefix.h"; GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; GCC_WARN_UNKNOWN_PRAGMAS = NO; INFOPLIST_FILE = "Tests/Test-BCFoundation/Test-BCFoundation-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; MACOSX_DEPLOYMENT_TARGET = ""; OTHER_CFLAGS = "-fobjc-exceptions"; OTHER_LDFLAGS = ( "-framework", Foundation, "-framework", AppKit, "-framework", SenTestingKit, ); OTHER_REZFLAGS = ""; PREBINDING = NO; PRODUCT_NAME = "Test - BCFoundation"; SECTORDER_FLAGS = ""; TEST_AFTER_BUILD = YES; WARNING_CFLAGS = "-Wmost"; }; name = Default; }; 5DC80DFB08835914008257D8 /* Development */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc"; GCC_OPTIMIZATION_LEVEL = 0; INFOPLIST_FILE = "Resources/$(INFOPLIST_FILE)"; MACOSX_DEPLOYMENT_TARGET = 10.4; ONLY_ACTIVE_ARCH = NO; SDKROOT = ""; }; name = Development; }; 5DC80DFC08835914008257D8 /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc"; GCC_OPTIMIZATION_LEVEL = s; INFOPLIST_FILE = "Resources/$(INFOPLIST_FILE)"; MACOSX_DEPLOYMENT_TARGET = 10.4; ONLY_ACTIVE_ARCH = NO; SDKROOT = ""; ZERO_LINK = NO; }; name = Deployment; }; 5DC80DFD08835914008257D8 /* Default */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc"; INFOPLIST_FILE = "Resources/$(INFOPLIST_FILE)"; MACOSX_DEPLOYMENT_TARGET = 10.4; ONLY_ACTIVE_ARCH = NO; SDKROOT = ""; }; name = Default; }; D6CCD07A0EC0E0F70073F096 /* Development */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; PRODUCT_NAME = Documentation; }; name = Development; }; D6CCD07B0EC0E0F70073F096 /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_FIX_AND_CONTINUE = NO; PRODUCT_NAME = Documentation; ZERO_LINK = NO; }; name = Deployment; }; D6CCD07C0EC0E0F70073F096 /* Default */ = { isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = Documentation; }; name = Default; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 5DC80DE608835914008257D8 /* Build configuration list for PBXNativeTarget "BioCocoa" */ = { isa = XCConfigurationList; buildConfigurations = ( 5DC80DE708835914008257D8 /* Development */, 5DC80DE808835914008257D8 /* Deployment */, 5DC80DE908835914008257D8 /* Default */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Development; }; 5DC80DEA08835914008257D8 /* Build configuration list for PBXNativeTarget "Test - BCFoundation" */ = { isa = XCConfigurationList; buildConfigurations = ( 5DC80DEB08835914008257D8 /* Development */, 5DC80DEC08835914008257D8 /* Deployment */, 5DC80DED08835914008257D8 /* Default */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Development; }; 5DC80DFA08835914008257D8 /* Build configuration list for PBXProject "BioCocoa" */ = { isa = XCConfigurationList; buildConfigurations = ( 5DC80DFB08835914008257D8 /* Development */, 5DC80DFC08835914008257D8 /* Deployment */, 5DC80DFD08835914008257D8 /* Default */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Development; }; D6CCD07D0EC0E0F70073F096 /* Build configuration list for PBXAggregateTarget "Documentation" */ = { isa = XCConfigurationList; buildConfigurations = ( D6CCD07A0EC0E0F70073F096 /* Development */, D6CCD07B0EC0E0F70073F096 /* Deployment */, D6CCD07C0EC0E0F70073F096 /* Default */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Development; }; /* End XCConfigurationList section */ }; rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; } biococoa-2.2.2/BCFoundation/2.0-cleanup/000755 000765 000024 00000000000 11455661313 020201 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/BCAlignment/000755 000765 000024 00000000000 11455661313 020400 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/BCAnalysis/000755 000765 000024 00000000000 11455661313 020245 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/BCFoundation.h000644 000765 000024 00000007075 11226023231 020735 0ustar00scottcstaff000000 000000 // // BCFoundation.h // BioCocoa // // Created by Alexander Griekspoor on 9/12/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Import this header file to use the BioCocoa Foundation framework. @discussion Import this header */ //////////////////////////////////////////////////////////////////////////// // BCFOUNDATION HEADER FILES //////////////////////////////////////////////////////////////////////////// // Defines #import #import // General Classes // BCGeneticCode #import #import #import #import // BCSequence #import #import #import #import // BCSequenceIO #import #import #import // BCSymbol #import #import #import #import #import // BCTools #import #import #import #import #import #import #import #import #import // BCUtils #import #import #import // BCSequenceAlignment #import #import // BCProteinStructure #import #import #import #import #import #import // BCGeneExpression #import #import #import #import // BCWebServices #ifndef GNUSTEP #import #endif biococoa-2.2.2/BCFoundation/BCFoundation.hdoc000644 000765 000024 00000000515 11070521237 021421 0ustar00scottcstaff000000 000000 /*! @framework BioCocoa Foundation Reference @abstract Open Source Bioinformatics Framework for Cocoa and GNUstep @discussion BioCocoa is an open source framework for bioinformatics written in Objective-C. It provides Cocoa and GNUstep programmers with a full suite of tools for handling and manipulating biological sequences. */ biococoa-2.2.2/BCFoundation/BCFoundationDefines.h000644 000765 000024 00000010063 11223237412 022227 0ustar00scottcstaff000000 000000 // // BCFoundationDefines.h // BioCocoa // // Created by Alexander Griekspoor on 9/12/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Global macros, enumerations and data structure for BioCocoa Foundation. @discussion This header declares global macros, enumerations and data structures for the BioCocoa Foundation Framework. Import the top-level header file BCFoundation.h to get these definitions as well as the BioCocoa Foundation classes. */ //////////////////////////////////////////////////////////////////////////// // GLOBAL DEFINES //////////////////////////////////////////////////////////////////////////// #define hydrogenMonoisotopicMass 1.00782503 #define oxygenMonoisotopicMass 15.99491463 #define hydrogenAverageMass 1.01 #define oxygenAverageMass 15.996 //////////////////////////////////////////////////////////////////////////// // GLOBAL ENUMs //////////////////////////////////////////////////////////////////////////// /*! @enum BCSequenceType @abstract A list of sequence types, for readability @constant BCSequenceTypeOther something we haven't thought of yet @constant BCSequenceTypeDNA DNA @constant BCSequenceTypeRNA RNA @constant BCSequenceTypeProtein Protein @constant BCSequenceTypeCodon Codon */ typedef enum BCSequenceType { BCSequenceTypeOther = 0, BCSequenceTypeDNA = 1, BCSequenceTypeRNA = 2, BCSequenceTypeProtein = 3, BCSequenceTypeCodon = 4 } BCSequenceType; /*! @enum BCGeneticCodeName @abstract Provides an ordered list of possible genetic codes. Allows for a lightweight, readable implementation. */ typedef enum BCGeneticCodeName { BCUniversalCode = 1, BCVertebrateMitochondrial = 2 } BCGeneticCodeName; /*! @enum BCMassType @abstract A list of mass types, for calculating molecular masses @constant BCMonoisotopic @constant BCAverage */ typedef enum BCMassType { BCMonoisotopic = 1, BCAverage = 2 } BCMassType; /*! @enum BCHydropathyType @abstract A list of hydropathy types, for calculating hydropathy values @constant BCKyteDoolittle @constant BCHoppWoods */ typedef enum BCHydropathyType { BCKyteDoolittle = 1, BCHoppWoods = 2 } BCHydropathyType; /*! @enum BCSecondaryStructureType @abstract A list of secondary structure types, for readability @constant BCAnyStructure something we haven't thought of yet @constant BCHelix Alpha helix @constant BCSheet Beta sheet @constant BCTurn Turn */ typedef enum BCSecondaryStructureType { BCAnyStructure = 0, BCHelix = 1, BCSheet = 2, BCTurn = 3 } BCSecondaryStructureType; biococoa-2.2.2/BCFoundation/BCGeneExpression/000755 000765 000024 00000000000 11455661313 021420 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/BCGeneticCode/000755 000765 000024 00000000000 11455661314 020634 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/BCInternal.h000644 000765 000024 00000007361 11370700423 020406 0ustar00scottcstaff000000 000000 // // BCInternal.h // BioCocoa // // Author: Scott Christley // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // CoreFoundation is significantly faster on Mac than the standard OpenStep API, but GNUstep does not // have CoreFoundation. We use macros pick one or the other. // #ifdef GNUSTEP // Variable declarations #define DECLARE_INDEX(variable) int variable // Range operations #define MAKE_RANGE(location, length) \ NSMakeRange((location), (length)) // Array operations #define ARRAY_GET_VALUE_AT_INDEX(array, index) \ [(array) objectAtIndex: (index)] #define ARRAY_APPEND_VALUE(array, object) \ [(array) addObject: (object)] #define ARRAY_INSERT_VALUE_AT_INDEX(array, index, object) \ [(array) insertObject: (object) atIndex: (index)] #define ARRAY_RANGE_CONTAINS_VALUE(array, range, object) \ bsinternal_array_range_contains_value((array), (range), (object)) #define ARRAY_GET_COUNT(array) \ [(array) count] static inline BOOL bsinternal_array_range_contains_value(NSArray *array, NSRange range, id object) { int i; for (i = range.location; i < range.location + range.length; ++i) { id o = [array objectAtIndex: i]; if ([o isEqual: object]) return YES; } return NO; } // Set operations #define SET_CONTAINS_VALUE(set, object) \ [(set) containsObject: (object)] // byte swapping --TODO-- #define CFSwapInt32BigToHost(x) (x) // HFS file types --TODO-- #define NSHFSTypeOfFile(file) (file) #else // Variable declarations #define DECLARE_INDEX(variable) CFIndex variable // Range operations #define MAKE_RANGE(location, length) \ CFRangeMake( (location), (length) ) // Array operations #define ARRAY_GET_VALUE_AT_INDEX(array, index) \ CFArrayGetValueAtIndex( (CFMutableArrayRef) (array), (index) ) #define ARRAY_APPEND_VALUE(array, object) \ CFArrayAppendValue ( (CFMutableArrayRef) (array), (object) ) #define ARRAY_INSERT_VALUE_AT_INDEX(array, index, object) \ CFArrayInsertValueAtIndex ( (CFMutableArrayRef) (array), (index), (object) ) #define ARRAY_RANGE_CONTAINS_VALUE(array, range, object) \ CFArrayContainsValue ( (CFArrayRef) (array), (range), (object) ) #define ARRAY_GET_COUNT(array) \ CFArrayGetCount ( (CFArrayRef) (array) ) // Set operations #define SET_CONTAINS_VALUE(set, object) \ CFSetContainsValue( (CFSetRef) (set), (object)); #endif /* GNUSTEP */ biococoa-2.2.2/BCFoundation/BCPreferences.h000644 000765 000024 00000003407 11223237412 021070 0ustar00scottcstaff000000 000000 // // BCPreferences.h // BioCocoa // // Created by Scott Christley on 10/07/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Global BioCocoa preferences. */ #import @interface BCPreferences : NSObject { } + (NSString *)sharedDataDirectory; + (NSString *)sharedDataSubdirectory: (NSString *)aDir; @end biococoa-2.2.2/BCFoundation/BCPreferences.m000644 000765 000024 00000005735 11223237412 021103 0ustar00scottcstaff000000 000000 // // BCPreferences.m // BioCocoa // // Created by Scott Christley on 10/07/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCPreferences.h" @implementation BCPreferences + (NSString *)sharedDataDirectory { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSUserDirectory, NSLocalDomainMask, YES); NSFileManager *mgr = [NSFileManager defaultManager]; NSString *s = [NSString stringWithString: [paths objectAtIndex: 0]]; s = [s stringByAppendingPathComponent:@"Shared"]; s = [s stringByAppendingPathComponent:@"BioCocoa"]; // check if path exists and create if necessary, read/write by all if (![mgr fileExistsAtPath: s]) { NSMutableDictionary *d = [NSMutableDictionary dictionary]; [d setObject: [NSNumber numberWithUnsignedLong: 0777] forKey: NSFilePosixPermissions]; if (![mgr createDirectoryAtPath: s attributes: d]) printf("Could not create %s\n", [s UTF8String]); return nil; } return s; } + (NSString *)sharedDataSubdirectory: (NSString *)aDir { NSString *s = [self sharedDataDirectory]; if (!s) return nil; s = [s stringByAppendingPathComponent: aDir]; NSFileManager *mgr = [NSFileManager defaultManager]; // check if path exists and create if necessary, read/write by all if (![mgr fileExistsAtPath: s]) { NSMutableDictionary *d = [NSMutableDictionary dictionary]; [d setObject: [NSNumber numberWithUnsignedLong: 0777] forKey: NSFilePosixPermissions]; if (![mgr createDirectoryAtPath: s attributes: d]) printf("Could not create %s\n", [s UTF8String]); return nil; } return s; } @end biococoa-2.2.2/BCFoundation/BCProteinStructure/000755 000765 000024 00000000000 11455661314 022024 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/BCSequence/000755 000765 000024 00000000000 11455661314 020233 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/BCSequenceIO/000755 000765 000024 00000000000 11455661313 020462 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/BCStringDefinitions.h000644 000765 000024 00000010426 11370700423 022270 0ustar00scottcstaff000000 000000 // // BCStringDefinitions.h // BioCocoa // // Created by Koen van der Drift on Thu Mar 17 2005. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Global property strings used by the BioCocoa Foundation framework. */ #import "BCInternal.h" // BCSymbol Strings /*! @constant BCSymbolNameProperty @abstract Symbol Name Property */ extern NSString * const BCSymbolNameProperty; /*! @constant BCSymbolMonoisotopicMassProperty @abstract Monoisotopic Mass Symbol Property */ extern NSString * const BCSymbolMonoisotopicMassProperty; /*! @constant BCSymbolAverageMassProperty @abstract Average Mass Symbol Property */ extern NSString * const BCSymbolAverageMassProperty; /*! @constant BCSymbolThreeLetterCodeProperty @abstract Three Letter Code Symbol Property */ extern NSString * const BCSymbolThreeLetterCodeProperty; /*! @constant BCSymbolpKaProperty @abstract Ka Symbol Property */ extern NSString * const BCSymbolpKaProperty; /*! @constant BCSymbolKyteDoolittleProperty @abstract Kyte Doolittle Symbol Property */ extern NSString * const BCSymbolKyteDoolittleProperty; /*! @constant BCSymbolHoppWoodsProperty @abstract Hopp Woods Symbol Property */ extern NSString * const BCSymbolHoppWoodsProperty; /*! @constant BCSymbolRepresentsProperty @abstract Represents Symbol Property */ extern NSString * const BCSymbolRepresentsProperty; /*! @constant BCSymbolRepresentedByProperty @abstract Represented By Symbol Property */ extern NSString * const BCSymbolRepresentedByProperty; /*! @constant BCSymbolAllComplementsProperty @abstract All Complements Symbol Property */ extern NSString * const BCSymbolAllComplementsProperty; /*! @constant BCSymbolComplementProperty @abstract Complement Symbol Property */ extern NSString * const BCSymbolComplementProperty; /*! @constant BCSymbolSymbolProperty @abstract Symbol Property */ extern NSString * const BCSymbolSymbolProperty; // BCAlignment Strings // Properties /*! @constant BCGapPenaltyProperty @abstract Gap Penalty Property */ extern NSString * const BCGapPenaltyProperty; // possible values /*! @constant BCDefaultGapPenalty @abstract Default Gap Property */ extern NSString * const BCDefaultGapPenalty; /*! @constant BCAffineGapPenalty @abstract Affine Gap Property */ extern NSString * const BCAffineGapPenalty; // substitution matrix /*! @constant BCSubstitutionMatrixProperty @abstract Substitution Matrix Property */ extern NSString * const BCSubstitutionMatrixProperty; // NSNumbers /*! @constant BCDefaultGapPenaltyProperty @abstract Default Gap Penalty Property */ extern NSString * const BCDefaultGapPenaltyProperty; /*! @constant BCGapOpenPenaltyProperty @abstract Gap Open Penalty Property */ extern NSString * const BCGapOpenPenaltyProperty; /*! @constant BCGapExtensionPenaltyProperty @abstract Gap Extension Penalty Property */ extern NSString * const BCGapExtensionPenaltyProperty; biococoa-2.2.2/BCFoundation/BCStringDefinitions.m000644 000765 000024 00000005705 11223237412 022301 0ustar00scottcstaff000000 000000 // // BCStringDefinitions.m // BioCocoa // // Created by Koen van der Drift on Mon Mar 21 2005. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import // BCSymbol Strings NSString * const BCSymbolNameProperty = @"Name"; NSString * const BCSymbolMonoisotopicMassProperty = @"MonoisotopicMass"; NSString * const BCSymbolAverageMassProperty = @"AverageMass"; NSString * const BCSymbolThreeLetterCodeProperty = @"ThreeLetterCode"; NSString * const BCSymbolpKaProperty = @"pKa"; NSString * const BCSymbolKyteDoolittleProperty = @"KyteDoolittle"; NSString * const BCSymbolHoppWoodsProperty = @"HoppWoods"; NSString * const BCSymbolRepresentsProperty = @"Represents"; NSString * const BCSymbolRepresentedByProperty = @"Represented by"; NSString * const BCSymbolAllComplementsProperty = @"All Complements"; NSString * const BCSymbolComplementProperty = @"Complement"; NSString * const BCSymbolSymbolProperty = @"Symbol"; // BCAlignment Strings // Properties NSString * const BCGapPenaltyProperty = @"BCGapPenaltyProperty"; // possible values NSString * const BCDefaultGapPenalty = @"BCDefaultGapPenalty"; NSString * const BCAffineGapPenalty = @"BCAffineGapPenalty"; // substitution matrix NSString * const BCSubstitutionMatrixProperty = @"BCSubstitutionMatrixProperty"; // NSNumbers NSString * const BCDefaultGapPenaltyProperty = @"BCDefaultGapPenaltyProperty"; NSString * const BCGapOpenPenaltyProperty = @"BCGapOpenPenaltyProperty"; NSString * const BCGapExtensionPenaltyProperty = @"BCGapExtensionPenaltyProperty"; biococoa-2.2.2/BCFoundation/BCSymbol/000755 000765 000024 00000000000 11455661314 017730 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/BCTools/000755 000765 000024 00000000000 11455661314 017563 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/BCUtils/000755 000765 000024 00000000000 11455661314 017563 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/BCWebServices/000755 000765 000024 00000000000 11455661313 020703 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/EntrezResult.h000644 000765 000024 00000007536 11223237412 021077 0ustar00scottcstaff000000 000000 // // EntrezResult.h // BioCocoa // // Created by Alexander Griekspoor // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import @interface EntrezResult : NSObject { //=========================================================================== // Variables and properties //=========================================================================== NSString* accession; NSString* description; NSString* species; NSString* extra; int db_id; } //=========================================================================== // Init & Dealloc //=========================================================================== - (id)initWithID: (int)value; - (id)initWithCoder: (NSCoder*) coder; - (void)dealloc; //=========================================================================== // Archiving and Unarchiving //=========================================================================== - (void)encodeWithCoder: (NSCoder *) coder; //=========================================================================== // Accessor methods //=========================================================================== - (NSString *)accession; - (void)setAccession:(NSString *)newAccession; - (NSString *)description; - (void)setDescription:(NSString *)newDescription; - (NSString *)species; - (void)setSpecies:(NSString *)newSpecies; - (int)db_id; - (void)setDb_id:(int)newDb_id; - (NSString *)extra; - (void)setExtra:(NSString *)newExtra; //=========================================================================== // General methods //=========================================================================== //=========================================================================== // Sorting //=========================================================================== - (NSComparisonResult)sortResultsOnIdAscending: (EntrezResult*) aResult; - (NSComparisonResult)sortResultsOnIdDescending:(EntrezResult*) aResult; - (NSComparisonResult)sortResultsOnAccessionAscending: (EntrezResult*) aResult; - (NSComparisonResult)sortResultsOnAccessionDescending:(EntrezResult*) aResult; - (NSComparisonResult)sortResultsOnDescriptionAscending: (EntrezResult*) aResult; - (NSComparisonResult)sortResultsOnDescriptionDescending:(EntrezResult*) aResult; - (NSComparisonResult)sortResultsOnSpeciesAscending: (EntrezResult*) aResult; - (NSComparisonResult)sortResultsOnSpeciesDescending:(EntrezResult*) aResult; @end biococoa-2.2.2/BCFoundation/EntrezResult.m000644 000765 000024 00000013447 11223237412 021102 0ustar00scottcstaff000000 000000 // // EntrezResult.m // BioCocoa // // Created by Alexander Griekspoor // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* This class encapsulates a result retrieved from Entrez using the controller class It makes life very easy to display results in a tableview */ #import "EntrezResult.h" #define kVersionNumber 1 @implementation EntrezResult //=========================================================================== // Init & Dealloc //=========================================================================== - (id)initWithID: (int)value; { if (self = [super init]){ [self setDb_id: value]; } return self; } - (id)initWithCoder: (NSCoder*) coder { self = [super init]; [self setAccession: [coder decodeObject]]; // restore name [self setDescription: [coder decodeObject]]; // restore type [self setSpecies: [coder decodeObject]]; // restore query [self setExtra: [coder decodeObject]]; // restore query [coder decodeValueOfObjCType: "i" at: &db_id]; return self; } - (void)dealloc // Object deallocation { [accession release]; [description release]; [species release]; [extra release]; [super dealloc]; } //=========================================================================== // Archiving and Unarchiving //=========================================================================== - (void)encodeWithCoder: (NSCoder *) coder { [coder encodeObject:accession]; [coder encodeObject:description]; [coder encodeObject:species]; [coder encodeObject:extra]; [coder encodeValueOfObjCType: "i" at: &db_id]; // store state of logging } //=========================================================================== // Accessor methods //=========================================================================== - (NSString *)accession { return accession; } - (void)setAccession:(NSString *)newAccession { [newAccession retain]; [accession release]; accession = newAccession; } - (NSString *)description { return description; } - (void)setDescription:(NSString *)newDescription { [newDescription retain]; [description release]; description = newDescription; } - (NSString *)species { return species; } - (void)setSpecies:(NSString *)newSpecies { [newSpecies retain]; [species release]; species = newSpecies; } - (int)db_id { return db_id; } - (void)setDb_id:(int)newDb_id { db_id = newDb_id; } - (NSString *)extra { return extra; } - (void)setExtra:(NSString *)newExtra { [newExtra retain]; [extra release]; extra = newExtra; } //=========================================================================== // General methods //=========================================================================== //=========================================================================== // Sorting //=========================================================================== - (NSComparisonResult)sortResultsOnIdAscending: (EntrezResult*) aResult{ if([self db_id] > [aResult db_id]){ return NSOrderedAscending; } else if([self db_id] < [aResult db_id]){ return NSOrderedDescending; } else return NSOrderedSame; } - (NSComparisonResult)sortResultsOnIdDescending:(EntrezResult*) aResult{ if([self db_id] < [aResult db_id]){ return NSOrderedAscending; } else if([self db_id] > [aResult db_id]){ return NSOrderedDescending; } else return NSOrderedSame; } - (NSComparisonResult)sortResultsOnAccessionAscending: (EntrezResult*) aResult{ return [[self accession] caseInsensitiveCompare: [aResult accession]]; } - (NSComparisonResult)sortResultsOnAccessionDescending:(EntrezResult*) aResult{ return [[aResult accession] caseInsensitiveCompare: [self accession]]; } - (NSComparisonResult)sortResultsOnDescriptionAscending: (EntrezResult*) aResult{ return [[self description] caseInsensitiveCompare: [aResult description]]; } - (NSComparisonResult)sortResultsOnDescriptionDescending:(EntrezResult*) aResult{ return [[aResult description] caseInsensitiveCompare: [self description]]; } - (NSComparisonResult)sortResultsOnSpeciesAscending: (EntrezResult*) aResult{ return [[self species] caseInsensitiveCompare: [aResult species]]; } - (NSComparisonResult)sortResultsOnSpeciesDescending:(EntrezResult*) aResult{ return [[aResult species] caseInsensitiveCompare: [self species]]; } @end biococoa-2.2.2/BCFoundation/GNUmakefile000644 000765 000024 00000004544 11370700423 020326 0ustar00scottcstaff000000 000000 # # GNUmakefile # # Written by: Scott Christley # Copyright (c) 2003-2009 The BioCocoa Project. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # This usually happens when you forget to source GNUstep.sh ifeq ($(GNUSTEP_MAKEFILES),) $(error You need to run the GNUstep configuration script before compiling!) endif include $(GNUSTEP_MAKEFILES)/common.make SUBPROJECT_NAME = BCFoundation -include GNUmakefile.preamble # # Because gnustep-make does not handle source split into multiple directories # very well, we create a single build directory and copy everything there. # BCFoundation_HEADER_FILES = \ BCFoundation.h \ BCFoundationDefines.h \ BCStringDefinitions.h \ BCPreferences.h BCFoundation_OBJC_FILES = \ BCStringDefinitions.m \ BCPreferences.m BCFoundation_SUBPROJECTS = \ BCAlignment \ BCAnalysis \ BCGeneExpression \ BCGeneticCode \ BCProteinStructure \ BCSequence \ BCSequenceIO \ BCSymbol \ BCTools \ BCUtils include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble biococoa-2.2.2/BCFoundation/GNUmakefile.preamble000644 000765 000024 00000006560 11226023231 022107 0ustar00scottcstaff000000 000000 # # GNUmakefile.preamble # # Written by: Scott Christley # Copyright (c) 2003-2009 The BioCocoa Project. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # # GNUmakefile.preamble # # Project specific makefile variables # # Do not put any Makefile rules in this file, instead they should # be put into GNUmakefile.postamble. # # # BioCocoa framework version info # BioCocoaFoundation_CURRENT_VERSION_NAME = A # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS = $(DEFS) $(CONFIG_SYSTEM_DEFS) \ -Wno-import \ -Wno-unknown-pragmas #-Wall \ #-Wcast-align \ #-Wstrict-prototypes \ #-Wpointer-arith \ #-Wcast-qual \ #-Wwrite-strings \ #-Wmissing-prototypes \ #-Wmissing-declarations \ #-Wredundant-decls \ #-Wnested-externs \ #-Winline \ #-Werror \ #-Wshadow #-Wconversion # subdirectories override this ifeq ($(BIOCOCOA_BASE_DIR),) BIOCOCOA_BASE_DIR = . endif # Additional flags to pass to the Objective-C compiler ADDITIONAL_OBJCFLAGS = # Additional flags to pass to the C compiler ADDITIONAL_CFLAGS = # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS = \ -I$(BIOCOCOA_BASE_DIR) \ -I$(BIOCOCOA_BASE_DIR)/BCAnalysis \ -I$(BIOCOCOA_BASE_DIR)/BCGeneticCode \ -I$(BIOCOCOA_BASE_DIR)/BCProteinStructure \ -I$(BIOCOCOA_BASE_DIR)/BCSequence \ -I$(BIOCOCOA_BASE_DIR)/BCSequenceIO \ -I$(BIOCOCOA_BASE_DIR)/BCSymbol \ -I$(BIOCOCOA_BASE_DIR)/BCTools \ -I$(BIOCOCOA_BASE_DIR)/BCTools/BCDigest \ -I$(BIOCOCOA_BASE_DIR)/BCTools/BCSequenceProperty \ -I$(BIOCOCOA_BASE_DIR)/BCTools/BCSequenceTools \ -I$(BIOCOCOA_BASE_DIR)/BCTools/BCTranslation \ -I$(BIOCOCOA_BASE_DIR)/BCUtils # Additional LDFLAGS to pass to the linker ADDITIONAL_LDFLAGS = # Additional library directories the linker should search #ADDITIONAL_LIB_DIRS = \ #-L$(BIOCOCOA_BASE_DIR)/BioCocoa.framework/Versions/$(BioCocoa_CURRENT_VERSION_NAME) # # Flags dealing with installing and uninstalling # # Additional directories to be created during installation ADDITIONAL_INSTALL_DIRS = biococoa-2.2.2/BCFoundation/Tests/000755 000765 000024 00000000000 11455661313 017357 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/Tests/TestFiles/000755 000765 000024 00000000000 11455661313 021261 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/BCWebServices/BCGeneExpressionOmnibus.h000644 000765 000024 00000004045 11223237412 025547 0ustar00scottcstaff000000 000000 // // BCGeneExpressionOmnibus.h // BioCocoa // // Created by Scott Christley on 10/07/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Retrieval of Gene Expression Omnibus data from NCBI. */ #import /*! @class BCGeneExpressionOmnibus @abstract Retrieval of Gene Expression Omnibus data from NCBI. @discussion The Gene Expression Omnibus at NCBI is a repository for gene expression data sets. */ @interface BCGeneExpressionOmnibus : NSObject { NSString *seriesName; } + (NSMutableArray *)retrieveGEOSeriesList; - (void)downloadGEOSeries:(NSString *)anAccession; @end biococoa-2.2.2/BCFoundation/BCWebServices/BCGeneExpressionOmnibus.m000644 000765 000024 00000054272 11223237412 025563 0ustar00scottcstaff000000 000000 // // // BCGeneExpressionOmnibus.m // BioCocoa // // Created by Scott Christley on 10/07/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCGeneExpressionOmnibus.h" #import "BCPreferences.h" #import "BCSeries.h" #include #include #include #include #include #include // getopt #include // strmode #include #include /* When using file streams, the 32KB buffer is probably not enough. A good way to establish a buffer size is to increase it over time. If every read consumes the entire buffer, start increasing the buffer size, and at some point you would then cap it. 32KB is fine for network sockets, although using the technique described above is still a good idea. This sample avoids the technique because of the added complexity it would introduce. */ #define kMyBufferSize 32768 /* MyStreamInfo holds the state of a particular operation (download, upload, or directory listing. Some fields are only valid for some operations, as explained by their comments. */ typedef struct MyStreamInfo { CFWriteStreamRef writeStream; // download (destination file stream) and upload (FTP stream) only CFReadStreamRef readStream; // download (FTP stream), upload (source file stream), directory list (FTP stream) CFDictionaryRef proxyDict; // necessary to workaround , per discussion below NSMutableArray *series; // hold the list of GEO series SInt64 fileSize; // download only, 0 indicates unknown UInt32 totalBytesWritten; // download and upload only UInt32 leftOverByteCount; // upload and directory list only, number of valid bytes at start of buffer UInt8 buffer[kMyBufferSize]; // buffer to hold left over bytes } MyStreamInfo; static const CFOptionFlags kNetworkEvents = kCFStreamEventOpenCompleted | kCFStreamEventHasBytesAvailable | kCFStreamEventEndEncountered | kCFStreamEventCanAcceptBytes | kCFStreamEventErrorOccurred; /* MyStreamInfoCreate creates a MyStreamInfo 'object' with the specified read and write stream. */ static void MyStreamInfoCreate(MyStreamInfo ** info, CFReadStreamRef readStream, CFWriteStreamRef writeStream) { MyStreamInfo * streamInfo; assert(info != NULL); assert(readStream != NULL); // writeStream may be NULL (this is the case for the directory list operation) streamInfo = malloc(sizeof(MyStreamInfo)); assert(streamInfo != NULL); streamInfo->readStream = readStream; streamInfo->writeStream = writeStream; streamInfo->proxyDict = NULL; // see discussion of below streamInfo->fileSize = 0; streamInfo->totalBytesWritten = 0; streamInfo->leftOverByteCount = 0; *info = streamInfo; } /* MyStreamInfoDestroy destroys a MyStreamInfo 'object', cleaning up any resources that it owns. */ static void MyStreamInfoDestroy(MyStreamInfo * info) { assert(info != NULL); if (info->readStream) { CFReadStreamUnscheduleFromRunLoop(info->readStream, CFRunLoopGetCurrent(), kCFRunLoopCommonModes); (void) CFReadStreamSetClient(info->readStream, kCFStreamEventNone, NULL, NULL); /* CFReadStreamClose terminates the stream. */ CFReadStreamClose(info->readStream); CFRelease(info->readStream); } if (info->writeStream) { CFWriteStreamUnscheduleFromRunLoop(info->writeStream, CFRunLoopGetCurrent(), kCFRunLoopCommonModes); (void) CFWriteStreamSetClient(info->writeStream, kCFStreamEventNone, NULL, NULL); /* CFWriteStreamClose terminates the stream. */ CFWriteStreamClose(info->writeStream); CFRelease(info->writeStream); } if (info->proxyDict) { CFRelease(info->proxyDict); // see discussion of below } free(info); } /* MyCFStreamSetUsernamePassword applies the specified user name and password to the stream. */ static void MyCFStreamSetUsernamePassword(CFTypeRef stream, CFStringRef username, CFStringRef password) { Boolean success; assert(stream != NULL); assert( (username != NULL) || (password == NULL) ); if (username && CFStringGetLength(username) > 0) { if (CFGetTypeID(stream) == CFReadStreamGetTypeID()) { success = CFReadStreamSetProperty((CFReadStreamRef)stream, kCFStreamPropertyFTPUserName, username); assert(success); if (password) { success = CFReadStreamSetProperty((CFReadStreamRef)stream, kCFStreamPropertyFTPPassword, password); assert(success); } } else if (CFGetTypeID(stream) == CFWriteStreamGetTypeID()) { success = CFWriteStreamSetProperty((CFWriteStreamRef)stream, kCFStreamPropertyFTPUserName, username); assert(success); if (password) { success = CFWriteStreamSetProperty((CFWriteStreamRef)stream, kCFStreamPropertyFTPPassword, password); assert(success); } } else { assert(false); } } } /* MyCFStreamSetFTPProxy applies the current proxy settings to the specified stream. This returns a reference to the proxy dictionary that we used because of , discussed below. */ static void MyCFStreamSetFTPProxy(CFTypeRef stream, CFDictionaryRef * proxyDictPtr) { CFDictionaryRef proxyDict; CFNumberRef passiveMode; CFBooleanRef isPassive; Boolean success; assert(stream != NULL); assert(proxyDictPtr != NULL); /* SCDynamicStoreCopyProxies gets the current Internet proxy settings. Then we call CFReadStreamSetProperty, with property name kCFStreamPropertyFTPProxy, to apply the settings to the FTP read stream. */ proxyDict = SCDynamicStoreCopyProxies(NULL); assert(proxyDict != NULL); /* Get the FTP passive mode setting from the proxy dictionary. Because of a bug setting the kCFStreamPropertyFTPProxy property using the SCDynamicStore proxy dictionary does not currently set the FTP passive mode setting on the stream, so we need to do it ourselves. Also, indicates that out in the real world some people are setting kSCPropNetProxiesFTPPassive to a Boolean, as opposed to a number. That's just incorrect, but I've hardened the code against it. */ passiveMode = CFDictionaryGetValue(proxyDict, kSCPropNetProxiesFTPPassive); if ( (passiveMode != NULL) && (CFGetTypeID(passiveMode) == CFNumberGetTypeID()) ) { int value; success = CFNumberGetValue(passiveMode, kCFNumberIntType, &value); assert(success); if (value) isPassive = kCFBooleanTrue; else isPassive = kCFBooleanFalse; } else { assert(false); isPassive = kCFBooleanTrue; // if prefs malformed, we just assume true } if (CFGetTypeID(stream) == CFReadStreamGetTypeID()) { success = CFReadStreamSetProperty((CFReadStreamRef)stream, kCFStreamPropertyFTPProxy, proxyDict); assert(success); success = CFReadStreamSetProperty((CFReadStreamRef)stream, kCFStreamPropertyFTPUsePassiveMode, isPassive); assert(success); } else if (CFGetTypeID(stream) == CFWriteStreamGetTypeID()) { success = CFWriteStreamSetProperty((CFWriteStreamRef)stream, kCFStreamPropertyFTPProxy, proxyDict); assert(success); success = CFWriteStreamSetProperty((CFWriteStreamRef)stream, kCFStreamPropertyFTPUsePassiveMode, isPassive); assert(success); } else { fprintf(stderr, "This is not a CFStream\n"); } /* Prior to Mac OS X 10.4, CFFTPStream has a bug that causes it to reference the proxy dictionary that you applied /after/ it has released its last reference to that dictionary. This causes a crash. We work around this bug by holding on to our own reference to the proxy dictionary until we're done with the stream. Thus, our reference prevents the dictionary from being disposed, and thus CFFTPStream can access it safely. So, rather than release our reference to the proxy dictionary, we pass it back to our caller and require it to release it. */ // CFRelease(proxyDict); After bug #3745574 is fixed, we'll be able to release the proxyDict here. *proxyDictPtr = proxyDict; } /* MyPrintDirectoryListing prints a FTP directory entry, represented by a CFDictionary as returned by CFFTPCreateParsedResourceListing, as a single line of text, much like you'd get from "ls -l". */ static void MyPrintDirectoryListing(CFDictionaryRef dictionary, NSMutableArray *series) { CFStringRef cfName; assert(dictionary != NULL); /* Note that this sample assumes UTF-8 since that's what the Mac OS X FTP server returns, however, some servers may use a different encoding. */ cfName = CFDictionaryGetValue(dictionary, kCFFTPResourceName); if (cfName) { assert(CFGetTypeID(cfName) == CFStringGetTypeID()); char p0 = CFStringGetCharacterAtIndex(cfName, 0); char p1 = CFStringGetCharacterAtIndex(cfName, 1); char p2 = CFStringGetCharacterAtIndex(cfName, 2); if ((p0 == 'G') && (p1 == 'S') && (p2 == 'E')) { [series addObject: [NSString stringWithString: (NSString *)cfName]]; } fprintf(stderr, "%s", [(NSString *)cfName UTF8String]); } fprintf(stderr, "\n"); } /* MyDirectoryListingCallBack is the stream callback for the CFFTPStream during a directory list operation. Its main purpose is to read bytes off the FTP stream, which is returning bytes of the directory listing, parse them, and 'pretty' print the resulting directory entries. */ static void MyDirectoryListingCallBack(CFReadStreamRef readStream, CFStreamEventType type, void * clientCallBackInfo) { MyStreamInfo *info = (MyStreamInfo *)clientCallBackInfo; CFIndex bytesRead; CFStreamError error; CFDictionaryRef parsedDict; assert(readStream != NULL); assert(info != NULL); assert(info->readStream == readStream); switch (type) { case kCFStreamEventOpenCompleted: fprintf(stderr, "Open complete\n"); break; case kCFStreamEventHasBytesAvailable: /* When we get here, there are bytes to be read from the stream. There are two cases: either info->leftOverByteCount is zero, in which case we complete processed the last buffer full of data (or we're at the beginning of the listing), or info->leftOverByteCount is non-zero, in which case there are that many bytes at the start of info->buffer that were left over from the last time that we were called. By definition, any left over bytes were insufficient to form a complete directory entry. In both cases, we just read the next chunk of data from the directory listing stream and append it to our buffer. We then process the buffer to see if it now contains any complete directory entries. */ /* CFReadStreamRead will return the number of bytes read, or -1 if an error occurs preventing any bytes from being read, or 0 if the stream's end was encountered. */ bytesRead = CFReadStreamRead(info->readStream, info->buffer + info->leftOverByteCount, kMyBufferSize - info->leftOverByteCount); if (bytesRead > 0) { const UInt8 * nextByte; CFIndex bytesRemaining; CFIndex bytesConsumedThisTime; /* Parse directory entries from the buffer until we either run out of bytes or we stop making forward progress (indicating that the buffer does not have enough bytes of valid data to make a complete directory entry). */ nextByte = info->buffer; bytesRemaining = bytesRead + info->leftOverByteCount; do { /* CFFTPCreateParsedResourceListing parses a line of file or folder listing of Unix format, and stores the extracted result in a CFDictionary. */ bytesConsumedThisTime = CFFTPCreateParsedResourceListing(NULL, nextByte, bytesRemaining, &parsedDict); if (bytesConsumedThisTime > 0) { /* It is possible for CFFTPCreateParsedResourceListing to return a positive number but not create a parse dictionary. For example, if the end of the listing text contains stuff that can't be parsed, CFFTPCreateParsedResourceListing returns a positive number (to tell the calle that it's consumed the data), but doesn't create a parse dictionary (because it couldn't make sens of the data). So, it's important that we only try to print parseDict if it's not NULL. */ if (parsedDict != NULL) { MyPrintDirectoryListing(parsedDict, info->series); CFRelease(parsedDict); } nextByte += bytesConsumedThisTime; bytesRemaining -= bytesConsumedThisTime; } else if (bytesConsumedThisTime == 0) { /* This should never happen because we supply a pretty large buffer. Still, we handle it by leaving the loop, which leaves the remaining bytes in the buffer. */ } else if (bytesConsumedThisTime == -1) { fprintf(stderr, "CFFTPCreateParsedResourceListing parse failure\n"); goto exit; } } while ( (bytesRemaining > 0) && (bytesConsumedThisTime > 0) ); /* If any bytes were left over, leave them in the buffer for next time. */ if (bytesRemaining > 0) { memmove(info->buffer, nextByte, bytesRemaining); } info->leftOverByteCount = bytesRemaining; } else { /* If bytesRead < 0, we've hit an error. If bytesRead == 0, we've hit the end of the directory listing. In either case, we do nothing, and rely on CF to call us with kCFStreamEventErrorOccurred or kCFStreamEventEndEncountered in order for us to do our clean up. */ } break; case kCFStreamEventErrorOccurred: error = CFReadStreamGetError(info->readStream); NSLog(@"CFReadStreamGetError returned (%d, %ld)\n", error.domain, error.error); goto exit; case kCFStreamEventEndEncountered: fprintf(stderr, "Listing complete\n"); goto exit; default: NSLog(@"Received unexpected CFStream event (%d)", type); break; } return; exit: MyStreamInfoDestroy(info); CFRunLoopStop(CFRunLoopGetCurrent()); return; } /* MySimpleDirectoryListing implements the directory list command. It sets up a MyStreamInfo 'object' with the read stream being an FTP stream of the directory to list and with no write stream. It then returns, and the real work happens asynchronously in the runloop. The function returns true if the stream setup succeeded, and false if it failed. */ static Boolean MySimpleDirectoryListing(CFStringRef urlString, CFStringRef username, CFStringRef password, NSMutableArray *anArray) { CFReadStreamRef readStream; CFStreamClientContext context = { 0, NULL, NULL, NULL, NULL }; CFURLRef downloadURL; Boolean success = true; MyStreamInfo *streamInfo; assert(urlString != NULL); downloadURL = CFURLCreateWithString(kCFAllocatorDefault, urlString, NULL); assert(downloadURL != NULL); /* Create an FTP read stream for downloading operation from an FTP URL. */ readStream = CFReadStreamCreateWithFTPURL(kCFAllocatorDefault, downloadURL); assert(readStream != NULL); CFRelease(downloadURL); /* Initialize our MyStreamInfo structure, which we use to store some information about the stream. */ MyStreamInfoCreate(&streamInfo, readStream, NULL); streamInfo->series = anArray; context.info = (void *)streamInfo; /* CFReadStreamSetClient registers a callback to hear about interesting events that occur on a stream. */ success = CFReadStreamSetClient(readStream, kNetworkEvents, MyDirectoryListingCallBack, &context); if (success) { /* Schedule a run loop on which the client can be notified about stream events. The client callback will be triggered via the run loop. It's the caller's responsibility to ensure that the run loop is running. */ CFReadStreamScheduleWithRunLoop(readStream, CFRunLoopGetCurrent(), kCFRunLoopCommonModes); MyCFStreamSetUsernamePassword(readStream, username, password); MyCFStreamSetFTPProxy(readStream, &streamInfo->proxyDict); /* CFReadStreamOpen will return success/failure. Opening a stream causes it to reserve all the system resources it requires. If the stream can open non-blocking, this will always return TRUE; listen to the run loop source to find out when the open completes and whether it was successful. */ success = CFReadStreamOpen(readStream); if (success == false) { fprintf(stderr, "CFReadStreamOpen failed\n"); MyStreamInfoDestroy(streamInfo); } } else { fprintf(stderr, "CFReadStreamSetClient failed\n"); MyStreamInfoDestroy(streamInfo); } return success; } @implementation BCGeneExpressionOmnibus // // Get list of all GEO series available from NCBI ftp // + (NSMutableArray *)retrieveGEOSeriesList { /* Retrieve the directory listing for the specified URL. */ NSMutableArray *a = [NSMutableArray new]; CFStringRef username = NULL, password = NULL; CFStringRef dirPath = CFStringCreateWithCString(NULL, "ftp://ftp.ncbi.nih.gov/pub/geo/DATA/SOFT/by_series/", kCFStringEncodingUTF8); Boolean status = MySimpleDirectoryListing(dirPath, username, password, a); if (status) CFRunLoopRun(); CFRelease(dirPath); if (!status) { [a release]; return nil; } else { return [a autorelease]; } } // // Get data files from Gene Omnibus // - (void)startDownloadingURL: (NSString *)aName { printf("downloading %s\n", [aName UTF8String]); // create the request NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:aName] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; // create the connection with the request // and start loading the data NSURLDownload *theDownload=[[NSURLDownload alloc] initWithRequest:theRequest delegate:self]; if (!theDownload) { // inform the user that the download could not be made NSLog(@"Download failed."); } } - (void)download:(NSURLDownload *)download decideDestinationWithSuggestedFilename:(NSString *)filename { NSString *destinationFilename; // Save in shared gene expression directory destinationFilename = [[BCPreferences sharedDataSubdirectory: @"GeneExpression"] stringByAppendingPathComponent:filename]; [download setDestination:destinationFilename allowOverwrite:YES]; } - (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error { // release the connection [download release]; // inform the user NSLog(@"Download failed! Error - %@ %@", [error localizedDescription], [[error userInfo] objectForKey:NSErrorFailingURLStringKey]); } - (void)downloadDidFinish:(NSURLDownload *)download { // release the connection [download release]; // Add the series if necessary BCSeries *aSeries = [BCSeries seriesWithId: seriesName]; if (!aSeries) { aSeries = [[BCSeries alloc] initWithId: seriesName]; [BCSeries addSeries: aSeries]; } } - (void)downloadGEOSeries:(NSString *)anAccession { // save the series name seriesName = anAccession; // ftp from Gene Omnibus NSMutableString *s = [NSMutableString string]; [s appendString: @"ftp://ftp.ncbi.nih.gov/pub/geo/DATA/SOFT/by_series/"]; [s appendString: anAccession]; [s appendString: @"/"]; [s appendString: anAccession]; [s appendString: @"_family.soft.gz"]; [self startDownloadingURL: s]; } @end biococoa-2.2.2/BCFoundation/BCUtils/BCDataMatrix.h000644 000765 000024 00000035253 11370700423 022176 0ustar00scottcstaff000000 000000 // // BCDataMatrix.h // BioCocoa // // Created by Scott Christley on 7/25/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // #import /*! @header @abstract Provides wrapper and utility methods for 2-dimensional data matrix. */ #if 0 #pragma mark == ENCODING STRINGS == #endif /*! @constant BCidEncode @abstract Encoding string for id (pointer) data type. */ extern char * const BCidEncode; /*! @constant BCintEncode @abstract Encoding string for integer data type. */ extern char * const BCintEncode; /*! @constant BCdoubleEncode @abstract Encoding string for double floating point data type. */ extern char * const BCdoubleEncode; /*! @constant BClongEncode @abstract Encoding string for long data type. */ extern char * const BClongEncode; /*! @constant BCboolEncode @abstract Encoding string for BOOL data type. */ extern char * const BCboolEncode; #if 0 #pragma mark == FORMAT STRINGS == #endif /*! @constant BCParseColumnNames @abstract Indicator for parsing column headings. @discussion Key for format dictionary entry to indicate whether BCDataMatrix should parse column names when reading data matrix from file. By default, BCDataMatrix assumes the file does not contain column names to be parsed. Set the value to boolean YES or NO, as shown with the following code example:
 @textblock
BCDataMatrix *aDataMatrix = [BCDataMatrix dataMatrixWithContentsOfFile: aFile
	andEncode: BCdoubleEncode
	andFormat: [NSDictionary dictionaryWithObjectsAndKeys:
		[NSNumber numberWithBool: YES], BCParseColumnNames, nil]];

 @/textblock
 
*/ extern NSString * const BCParseColumnNames; /*! @constant BCParseRowNames @abstract Indicator for parsing row headings. @discussion Key for format dictionary entry to indicate whether BCDataMatrix should parse row names when reading data matrix from file. By default, BCDataMatrix assumes the file does not contain row names to be parsed. Set the value to boolean YES or NO, as shown with the following code example:
 @textblock
BCDataMatrix *aDataMatrix = [BCDataMatrix dataMatrixWithContentsOfFile: aFile
	andEncode: BCdoubleEncode
	andFormat: [NSDictionary dictionaryWithObjectsAndKeys:
		[NSNumber numberWithBool: YES], BCParseRowNames, nil]];

 @/textblock
 
If parsing column names is also set, then BCDataMatrix assumes that the column containing the row names also has a column heading. */ extern NSString * const BCParseRowNames; /*! @constant BCColumnNames @abstract Array of column headings. @discussion Key for format dictionary entry to provide an array of column names. Useful if the data file does not provide column headings but would like to access columns by name instead of index. Column names must be provided when parsing a data file in BCListFormat but are optional for a data file in BCMatrixFormat. */ extern NSString * const BCColumnNames; /*! @constant BCRowNames @abstract Array of row headings. @discussion Key for format dictionary entry to provide an array of row names. Useful if the data file does not provide row headings but would like to access rows by name instead of index. Row names must be provided when parsing a data file in BCListFormat but are optional for a data file in BCMatrixFormat. */ extern NSString * const BCRowNames; /*! @constant BCDataLayout @abstract Indicator for data layout. @discussion Key for format dictionary entry to indicate the layout of the data when reading from a file. The value should be either BCMatrixFormat or BCListFormat. */ extern NSString * const BCDataLayout; /*! @constant BCMatrixFormat @abstract Indicate data file is in matrix format. @discussion Value for format dictionary entry to indicate the data in the file is in matrix format. Matrix format assumes each line the data file corresponds to a row in the data matrix and each column in that row separate by BCSeparatorCharacterSet. For example, the following data is in matrix form to produce a 4x3 matrix, 4 rows and 3 columns.
 @textblock
1	2	3
4	5	6
7	8	9
10	11	12
 @/textblock
 
If the data layout is not specified, BCDataMatrix assumes the data file is in matrix format. */ extern NSString * const BCMatrixFormat; /*! @constant BCListFormat @abstract Indicate data file is in list format. @discussion Value for format dictionary entry to indicate the data in the file is in list format. List format assumes each line the data file corresponds to a single matrix entry. Each line in the data file has exactly 3 fields, separated by BCSeparatorCharacterSet, with the first field being the row name, second field being the column name, and the third field being the value for the matrix entry. For example, the following data is in list format to produce a 4x3 matrix, 4 rows and 3 columns.
 @textblock
r1	c1	1
r1	c2	2
r1	c3	3
r2	c2	5
r3	c1	7
r4	c3	12
 @/textblock
 
BCRowNames and BCColumnNames must be provided to BCDataMatrix for reading data in list format. The entries can be specified in any order, if a matrix entry appears more than once then the last value in the file is used. Not all entries need to be provided, unspecified matrix entries will be left the default empty value. */ extern NSString * const BCListFormat; /*! @constant BCSeparatorCharacterSet @abstract Character set for separating entries. @discussion Key for format dictionary entry to specify the NSCharacterSet to be used for splitting matrix entries. If no value is provided then [NSCharacterSet whitespaceCharacterSet] is used as the default character set. */ extern NSString * const BCSeparatorCharacterSet; /*! @class BCDataMatrix @abstract Wrapper class for 2-dimensional data matrix. @discussion This class provide a wrapper and convenience utility methods for managing a 2-dimensional data matrix. The data matrix can be any standard C data type as well custom data types, and it is efficiently stored in memory. Convenience methods include reading/writing the data from/to files, converting between row major and column major storage (for C or Fortran use) and obtaining submatrices. */ @interface BCDataMatrix : NSObject { unsigned int numOfRows; NSArray *rowNames; unsigned int numOfCols; NSArray *colNames; char *encode; void *dataMatrix; BOOL isColumnMajor; // C is row major, Fortran is column major } #if 0 #pragma mark == ALLOCATION METHODS == #endif /*! @method emptyDataMatrixWithRows:andColumns:andEncode: @abstract Create an empty data matrix. @discussion This method creates an empty BCDataMatrix with the specfied number of rows and column, using the specified encoding. */ + (BCDataMatrix *)emptyDataMatrixWithRows: (unsigned int)rows andColumns: (unsigned int)cols andEncode: (char *)anEncode; /*! @method dataMatrixWithContentsOfFile:andEncode: @abstract Create data matrix from contents of file. @discussion This method creates a BCDataMatrix with the data in the specified file. The data is assumed to be in the default layout which is BCMatrixFormat without row or column names. */ + (BCDataMatrix *)dataMatrixWithContentsOfFile: (NSString *)aFile andEncode: (char *)anEncode; /*! @method dataMatrixWithContentsOfFile:andEncode:andFormat: @abstract Create data matrix from contents of file. @discussion This method creates a BCDataMatrix with the data in the specified file. The layout of the data is specified with the format dictionary. If the format dictionary parameter is nil then the default layout is assumed. */ + (BCDataMatrix *)dataMatrixWithContentsOfFile: (NSString *)aFile andEncode: (char *)anEncode andFormat: (NSDictionary *)format; /*! @method dataMatrixWithRowMajorMatrix:numberOfRows:andColumns:andEncode: @abstract Create data matrix from data. @discussion This method creates a BCDataMatrix with the provided data matrix. It is assumed the data matrix is C style matrix with values in row major form. */ + (BCDataMatrix *)dataMatrixWithRowMajorMatrix: (void *)aMatrix numberOfRows: (unsigned int)rows andColumns: (unsigned int)cols andEncode: (char *)anEncode; /*! @method dataMatrixWithColumnMajorMatrix:numberOfRows:andColumns:andEncode: @abstract Create data matrix from data. @discussion This method creates a BCDataMatrix with the provided data matrix. It is assumed the data matrix is FORTRAN style matrix with values in column major form. */ + (BCDataMatrix *)dataMatrixWithColumnMajorMatrix: (void *)aMatrix numberOfRows: (unsigned int)rows andColumns: (unsigned int)cols andEncode: (char *)anEncode; /*! @method initEmptyDataMatrixWithRows:andColumns:andEncode: @abstract Initialize an empty data matrix. @discussion This method initializes an empty BCDataMatrix with the specfied number of rows and column, using the specified encoding. */ - (BCDataMatrix *)initEmptyDataMatrixWithRows: (unsigned int)rows andColumns: (unsigned int)cols andEncode: (char *)anEncode; /*! @method initWithContentsOfFile:andEncode: @abstract Initializes data matrix with contents of file. @discussion This method initializes a BCDataMatrix with the data in the specified file. The data is assumed to be in the default layout which is BCMatrixFormat without row or column names. */ - (BCDataMatrix *)initWithContentsOfFile: (NSString *)aFile andEncode: (char *)anEncode; /*! @method initWithContentsOfFile:andEncode:andFormat: @abstract Initializes data matrix with contents of file. @discussion This method initializes a BCDataMatrix with the data in the specified file. The layout of the data is specified with the format dictionary. If the format dictionary parameter is nil then the default layout is assumed. */ - (BCDataMatrix *)initWithContentsOfFile: (NSString *)aFile andEncode: (char *)anEncode andFormat: (NSDictionary *)format; /*! @method initWithRowMajorMatrix:numberOfRows:andColumns:andEncode: @abstract Initializes data matrix from data. @discussion This method initializes a BCDataMatrix with the provided data matrix. It is assumed the data matrix is C-style matrix with values in row major form. */ - (BCDataMatrix *)initWithRowMajorMatrix: (void *)aMatrix numberOfRows: (unsigned int)rows andColumns: (unsigned int)cols andEncode: (char *)anEncode; /*! @method initWithColumnMajorMatrix:numberOfRows:andColumns:andEncode: @abstract Initializes data matrix from data. @discussion This method initializes a BCDataMatrix with the provided data matrix. It is assumed the data matrix is FORTRAN-style matrix with values in column major form. */ - (BCDataMatrix *)initWithColumnMajorMatrix: (void *)aMatrix numberOfRows: (unsigned int)rows andColumns: (unsigned int)cols andEncode: (char *)anEncode; /*! @method numberOfRows @abstract Returns number of rows in data matrix. */ - (unsigned int)numberOfRows; /*! @method numberOfColumns @abstract Returns number of columns in data matrix. */ - (unsigned int)numberOfColumns; /*! @method dataMatrix @abstract Returns the underlying memory allocation of the data matrix. @discussion This method provides the underlying memory allocation of the data matrix to allow for fast access and updating of the matrix elements; the memory is allocated in a single contiguous block so the memory can be cast to a C-style matrix for simplified access. Be sure to use the proper encoding to access the matrix elements when casting the pointer, and check isColumnMajor if you need to support both C and FORTRAN layouts. The following code shows a simple iterator assuming double encoding.
 @textblock
int numRows = [aDataMatrix numberOfRows];
int numCols = [aDataMatrix numberOfCols];
double (*grid)[numRows][numCols];
grid = [aDataMatrix dataMatrix];
for (i = 0; i < numRows; ++i)
	for (j = 0; j < numCols; ++j)
		(*grid)[i][j] = 1.0;
	
 @/textblock
 
*/ - (void *)dataMatrix; /*! @method matrixEncoding @abstract Returns encoding string for data matrix. */ - (char *)matrixEncoding; /*! @method isColumnMajor @abstract Returns data layout in underlying memory allocation. @discussion Returns YES if data is in FORTRAN-style column major format otherwise returns NO for data in C-style row major format. */ - (BOOL)isColumnMajor; /*! @method setColumnMajor: @abstract Changes data layout in underlying memory allocation. @discussion C-style matrices are in row major form which means that all columns for a single row are contiguous in memory. FORTRAN-style matrices are in column major form which means that all rows for a single column are contiguous in memory. This method can switch the memory layout from one format to the other. This is a convenience method for mixed C and FORTRAN programs where data needs to be passed back and forth between C and FORTRAN functions. By default, BCDataMatrix stores data in C-style row major format. */ - (void)setColumnMajor: (BOOL)aFlag; /*! @method dataMatrixFromRowRange:andColumnRange: @abstract Returns new BCDataMatrix with subset of data matrix. @discussion This method extracts the specified sub-matrix and creates a new BCDataMatrix with the data from that sub-matrix. Returns nil if the ranges are outside the bounds of the data matrix or if no row/column size is zero. The new BCDataMatrix has the same data encoding and data layout with the number of rows and columns equal to the sizes of the specified ranges. */ - (BCDataMatrix *)dataMatrixFromRowRange: (NSRange)rows andColumnRange: (NSRange)cols; @end biococoa-2.2.2/BCFoundation/BCUtils/BCDataMatrix.m000644 000765 000024 00000037332 11455660036 022214 0ustar00scottcstaff000000 000000 // // BCDataMatrix.m // BioCocoa // // Created by Scott Christley on 7/25/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // #import "BCDataMatrix.h" #import "BCInternal.h" char * const BCidEncode = @encode(id); char * const BCintEncode = @encode(int); char * const BCdoubleEncode = @encode(double); char * const BClongEncode = @encode(long); char * const BCboolEncode = @encode(BOOL); NSString * const BCParseColumnNames = @"parseColumnNames"; NSString * const BCParseRowNames = @"parseRowNames"; NSString * const BCColumnNames = @"columnNames"; NSString * const BCRowNames = @"rowNames"; NSString * const BCDataLayout = @"dataLayout"; NSString * const BCMatrixFormat = @"matrixFormat"; NSString * const BCListFormat = @"listFormat"; NSString * const BCSeparatorCharacterSet = @"separatorCharacterSet"; @implementation BCDataMatrix + (BCDataMatrix *)emptyDataMatrixWithRows: (unsigned int)rows andColumns: (unsigned int)cols andEncode: (char *)anEncode { return [[self alloc] initEmptyDataMatrixWithRows: rows andColumns: cols andEncode: anEncode]; } + (BCDataMatrix *)dataMatrixWithContentsOfFile: (NSString *)aFile andEncode: (char *)anEncode { return [[self alloc] initWithContentsOfFile: aFile andEncode: anEncode]; } + (BCDataMatrix *)dataMatrixWithContentsOfFile: (NSString *)aFile andEncode: (char *)anEncode andFormat: (NSDictionary *)format { return [[self alloc] initWithContentsOfFile: aFile andEncode: anEncode andFormat: format]; } + (BCDataMatrix *)dataMatrixWithRowMajorMatrix: (void *)aMatrix numberOfRows: (unsigned int)rows andColumns: (unsigned int)cols andEncode: (char *)anEncode { return [[self alloc] initWithRowMajorMatrix: aMatrix numberOfRows: rows andColumns: cols andEncode: anEncode]; } + (BCDataMatrix *)dataMatrixWithColumnMajorMatrix: (void *)aMatrix numberOfRows: (unsigned int)rows andColumns: (unsigned int)cols andEncode: (char *)anEncode { return [[self alloc] initWithColumnMajorMatrix: aMatrix numberOfRows: rows andColumns: cols andEncode: anEncode]; } - (BCDataMatrix *)initEmptyDataMatrixWithRows: (unsigned int)rows andColumns: (unsigned int)cols andEncode: (char *)anEncode { [super init]; numOfRows = rows; numOfCols = cols; encode = anEncode; isColumnMajor = NO; int i, j; if (!strcmp(encode, BCidEncode)) { dataMatrix = malloc(sizeof(id) * numOfRows * numOfCols); id (*grid)[numOfRows][numOfCols] = dataMatrix; for (i = 0;i < numOfRows; ++i) for (j = 0;j < numOfCols; ++j) (*grid)[i][j] = nil; } else if (!strcmp(encode, BCintEncode)) { dataMatrix = malloc(sizeof(int) * numOfRows * numOfCols); int (*grid)[numOfRows][numOfCols] = dataMatrix; for (i = 0;i < numOfRows; ++i) for (j = 0;j < numOfCols; ++j) (*grid)[i][j] = 0; } else if (!strcmp(encode, BClongEncode)) { dataMatrix = malloc(sizeof(long) * numOfRows * numOfCols); long (*grid)[numOfRows][numOfCols] = dataMatrix; for (i = 0;i < numOfRows; ++i) for (j = 0;j < numOfCols; ++j) (*grid)[i][j] = 0; } else if (!strcmp(encode, BCdoubleEncode)) { dataMatrix = malloc(sizeof(double) * numOfRows * numOfCols); double (*grid)[numOfRows][numOfCols] = dataMatrix; for (i = 0;i < numOfRows; ++i) for (j = 0;j < numOfCols; ++j) (*grid)[i][j] = 0.0; } else if (!strcmp(encode, BCboolEncode)) { dataMatrix = malloc(sizeof(BOOL) * numOfRows * numOfCols); BOOL (*grid)[numOfRows][numOfCols] = dataMatrix; for (i = 0;i < numOfRows; ++i) for (j = 0;j < numOfCols; ++j) (*grid)[i][j] = NO; } else { // throw exception or something NSLog(@"ERROR: BCDataMatrix unknown encoding %s\n", anEncode); return nil; } return self; } - (BCDataMatrix *)initWithContentsOfFile: (NSString *)aFile andEncode: (char *)anEncode { return [self initWithContentsOfFile: aFile andEncode: anEncode andFormat: nil]; } - (BCDataMatrix *)initWithContentsOfFile: (NSString *)aFile andEncode: (char *)anEncode andFormat: (NSDictionary *)format { BOOL parseRowNames, parseColNames, matrixLayout; NSCharacterSet *separator; // default format is no row/column names and matrix layout parseRowNames = NO; parseColNames = NO; matrixLayout = YES; separator = [NSCharacterSet whitespaceCharacterSet]; if (format) { NSString *s = [format objectForKey: BCDataLayout]; if ([s isEqualToString: BCListFormat]) matrixLayout = NO; if (matrixLayout) { // we can parse the row/columns in matrix layout s = [format objectForKey: BCParseColumnNames]; if (s && [s boolValue]) parseColNames = YES; s = [format objectForKey: BCParseRowNames]; if (s && [s boolValue]) parseRowNames = YES; } else { // row/columns names must be given to us for list layout colNames = (NSArray *)[format objectForKey: BCColumnNames]; if (!colNames) { NSLog(@"ERROR: List of column names required for list layout"); return nil; } colNames = [[NSArray alloc] initWithArray: colNames]; numOfCols = [colNames count]; rowNames = (NSArray *)[format objectForKey: BCRowNames]; if (!rowNames) { NSLog(@"ERROR: List of row names required for list layout"); return nil; } rowNames = [[NSArray alloc] initWithArray: rowNames]; numOfRows = [rowNames count]; } s = [format objectForKey: BCSeparatorCharacterSet]; if (s) separator = (NSCharacterSet *)s; } NSString *contents = [NSString stringWithContentsOfFile: aFile]; if (!contents) { NSLog(@"ERROR: Unable to read contents of file: %@", aFile); return nil; } if (matrixLayout) { NSUInteger start, end, next; NSUInteger i, j; NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSRange range; unsigned stringLength = [contents length]; BOOL parseFailure = NO; // scan through it once to determine number of rows and columns range.location = 0; range.length = 1; i = 0; j = 0; do { // one line at a time [contents getLineStart:&start end:&next contentsEnd:&end forRange:range]; range.location = start; range.length = end-start; NSString *s = [contents substringWithRange: range]; // skip empty lines if ([s length] == 0) { range.location = next; range.length = 1; continue; } NSArray *a = [s componentsSeparatedByCharactersInSet: separator]; if (i == 0) { if (parseColNames) { colNames = [[NSArray alloc] initWithArray: a]; numOfCols = [a count]; if (parseRowNames) --numOfCols; } else { if (parseRowNames) { numOfCols = [a count] - 1; } else { numOfCols = [a count]; } } } ++i; range.location = next; range.length = 1; } while (next < stringLength); int expectCols = numOfCols; if (parseRowNames) { rowNames = [NSMutableArray new]; expectCols = numOfCols + 1; } numOfRows = i; if (parseColNames) --numOfRows; [self initEmptyDataMatrixWithRows: numOfRows andColumns: numOfCols andEncode: anEncode]; // scan through again to parse the data range.location = 0; range.length = 1; i = 0; j = 0; do { // one line at a time [contents getLineStart:&start end:&next contentsEnd:&end forRange:range]; range.location = start; range.length = end-start; NSString *s = [contents substringWithRange: range]; // skip empty lines if ([s length] == 0) { range.location = next; range.length = 1; continue; } if ((i == 0) && (parseColNames)) { // skip the column names parseColNames = NO; } else { NSArray *a = [s componentsSeparatedByCharactersInSet: separator]; if ([a count] != expectCols) { NSLog(@"Invalid matrix format for data matrix, expected %d items, got %d", expectCols, [a count]); NSLog(@"Offending line:"); NSLog(@"%@", s); parseFailure = YES; break; } if (parseRowNames) [(NSMutableArray *)rowNames addObject: [a objectAtIndex: 0]]; if (!strcmp(encode, BCidEncode)) { id (*grid)[numOfRows][numOfCols] = dataMatrix; for (j = 0; j < numOfCols; ++j) if (parseRowNames) (*grid)[i][j] = [a objectAtIndex: (j + 1)]; else (*grid)[i][j] = [a objectAtIndex: j]; } else if (!strcmp(encode, BCintEncode)) { int (*grid)[numOfRows][numOfCols] = dataMatrix; for (j = 0; j < numOfCols; ++j) if (parseRowNames) (*grid)[i][j] = [[a objectAtIndex: (j + 1)] intValue]; else (*grid)[i][j] = [[a objectAtIndex: j] intValue]; } else if (!strcmp(encode, BClongEncode)) { long (*grid)[numOfRows][numOfCols] = dataMatrix; for (j = 0; j < numOfCols; ++j) if (parseRowNames) (*grid)[i][j] = [[a objectAtIndex: (j + 1)] longValue]; else (*grid)[i][j] = [[a objectAtIndex: j] longValue]; } else if (!strcmp(encode, BCdoubleEncode)) { double (*grid)[numOfRows][numOfCols] = dataMatrix; for (j = 0; j < numOfCols; ++j) if (parseRowNames) (*grid)[i][j] = [[a objectAtIndex: (j + 1)] doubleValue]; else (*grid)[i][j] = [[a objectAtIndex: j] doubleValue]; } else if (!strcmp(encode, BCboolEncode)) { BOOL (*grid)[numOfRows][numOfCols] = dataMatrix; for (j = 0; j < numOfCols; ++j) if (parseRowNames) (*grid)[i][j] = [[a objectAtIndex: (j + 1)] boolValue]; else (*grid)[i][j] = [[a objectAtIndex: j] boolValue]; } ++i; } range.location = next; range.length = 1; } while (next < stringLength); [pool release]; if (parseFailure) { [self dealloc]; return nil; } } else { // The list layout has one line for each entry in the format // rowName colName value NSUInteger start, end, next; NSUInteger i, j; NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSRange range; unsigned stringLength = [contents length]; BOOL parseFailure = NO; [self initEmptyDataMatrixWithRows: numOfRows andColumns: numOfCols andEncode: anEncode]; range.location = 0; range.length = 1; do { // one line at a time [contents getLineStart:&start end:&next contentsEnd:&end forRange:range]; range.location = start; range.length = end-start; NSString *s = [contents substringWithRange: range]; // skip empty lines if ([s length] == 0) { range.location = next; range.length = 1; continue; } NSArray *a = [s componentsSeparatedByCharactersInSet: separator]; if ([a count] != 3) { NSLog(@"Invalid list format for data matrix, expected 3 items, got %d", [a count]); NSLog(@"Offending line:"); NSLog(@"%@", s); parseFailure = YES; break; } i = [rowNames indexOfObject: [a objectAtIndex: 0]]; if (i == NSNotFound) { NSLog(@"Found unknown row name in file: %@", [a objectAtIndex: 0]); NSLog(@"Offending line:"); NSLog(@"%@", s); parseFailure = YES; break; } j = [rowNames indexOfObject: [a objectAtIndex: 1]]; if (j == NSNotFound) { NSLog(@"Found unknown row name in file: %@", [a objectAtIndex: 1]); NSLog(@"Offending line:"); NSLog(@"%@", s); parseFailure = YES; break; } if (!strcmp(encode, BCidEncode)) { id (*grid)[numOfRows][numOfCols] = dataMatrix; (*grid)[i][j] = [a objectAtIndex: 2]; } else if (!strcmp(encode, BCintEncode)) { int (*grid)[numOfRows][numOfCols] = dataMatrix; (*grid)[i][j] = [[a objectAtIndex: 2] intValue]; } else if (!strcmp(encode, BClongEncode)) { long (*grid)[numOfRows][numOfCols] = dataMatrix; (*grid)[i][j] = [[a objectAtIndex: 2] longValue]; } else if (!strcmp(encode, BCdoubleEncode)) { double (*grid)[numOfRows][numOfCols] = dataMatrix; (*grid)[i][j] = [[a objectAtIndex: 2] doubleValue]; } else if (!strcmp(encode, BCboolEncode)) { BOOL (*grid)[numOfRows][numOfCols] = dataMatrix; (*grid)[i][j] = [[a objectAtIndex: 2] boolValue]; } range.location = next; range.length = 1; } while (next < stringLength); [pool release]; if (parseFailure) { [self dealloc]; return nil; } } return self; } - (BCDataMatrix *)initWithRowMajorMatrix: (void *)aMatrix numberOfRows: (unsigned int)rows andColumns: (unsigned int)cols andEncode: (char *)anEncode { return nil; } - (BCDataMatrix *)initWithColumnMajorMatrix: (void *)aMatrix numberOfRows: (unsigned int)rows andColumns: (unsigned int)cols andEncode: (char *)anEncode { return nil; } - (void)dealloc { if (rowNames) [rowNames release]; if (colNames) [colNames release]; if (dataMatrix) free(dataMatrix); [super dealloc]; } - (unsigned int)numberOfRows { return numOfRows; } - (unsigned int)numberOfColumns { return numOfCols; } - (void *)dataMatrix { return dataMatrix; } - (char *)matrixEncoding { return encode; } - (BOOL)isColumnMajor { return isColumnMajor; } - (void)setColumnMajor: (BOOL)aFlag { if (aFlag == isColumnMajor) return; // TODO: convert matrix isColumnMajor = aFlag; } - (BCDataMatrix *)dataMatrixFromRowRange: (NSRange)rows andColumnRange: (NSRange)cols { // check valid ranges if ((rows.length == 0) || (cols.length == 0)) return nil; if ((rows.location + rows.length) > numOfRows) return nil; if ((cols.location + cols.length) > numOfCols) return nil; BCDataMatrix *newMatrix = [BCDataMatrix emptyDataMatrixWithRows: rows.length andColumns: cols.length andEncode: encode]; int i, j; if (!strcmp(encode, BCidEncode)) { id (*grid1)[numOfRows][numOfCols] = dataMatrix; id (*grid2)[rows.length][cols.length] = [newMatrix dataMatrix]; for (i = 0;i < rows.length; ++i) for (j = 0;j < cols.length; ++j) (*grid2)[i][j] = (*grid1)[i + rows.location][j + cols.location]; } else if (!strcmp(encode, BCintEncode)) { int (*grid1)[numOfRows][numOfCols] = dataMatrix; int (*grid2)[rows.length][cols.length] = [newMatrix dataMatrix]; for (i = 0;i < rows.length; ++i) for (j = 0;j < cols.length; ++j) (*grid2)[i][j] = (*grid1)[i + rows.location][j + cols.location]; } else if (!strcmp(encode, BClongEncode)) { long (*grid1)[numOfRows][numOfCols] = dataMatrix; long (*grid2)[rows.length][cols.length] = [newMatrix dataMatrix]; for (i = 0;i < rows.length; ++i) for (j = 0;j < cols.length; ++j) (*grid2)[i][j] = (*grid1)[i + rows.location][j + cols.location]; } else if (!strcmp(encode, BCdoubleEncode)) { double (*grid1)[numOfRows][numOfCols] = dataMatrix; double (*grid2)[rows.length][cols.length] = [newMatrix dataMatrix]; for (i = 0;i < rows.length; ++i) for (j = 0;j < cols.length; ++j) (*grid2)[i][j] = (*grid1)[i + rows.location][j + cols.location]; } else if (!strcmp(encode, BCboolEncode)) { BOOL (*grid1)[numOfRows][numOfCols] = dataMatrix; BOOL (*grid2)[rows.length][cols.length] = [newMatrix dataMatrix]; for (i = 0;i < rows.length; ++i) for (j = 0;j < cols.length; ++j) (*grid2)[i][j] = (*grid1)[i + rows.location][j + cols.location]; } return newMatrix; } @end biococoa-2.2.2/BCFoundation/BCUtils/BCUtilCGI.h000644 000765 000024 00000002033 10404057133 021366 0ustar00scottcstaff000000 000000 // // BCUtilCGI.h // BioCocoa ////////////////////////////////////////////////////////////////////////////////// // // Static methods that are useful when called from main() within the // context of a CGI app // ////////////////////////////////////////////////////////////////////////////////// // Created by John Timmer on Fri Jul 30 2004. // Copyright (c) 2004 The BioCocoa Project. All rights reserved. // #import @interface BCUtilCGI : NSObject { } // finds any data sent to the CGI application from the form which triggers it // each data item is a dictionary entry with its name as the key. // this will return nil if there was no input or trouble readin the input. + (NSDictionary *) retrieveFormData; // allows an informative error message to be sent as HTML output, typically prior // to exiting the application (it allows you to avoid having your whole application // be a series of nested if statements before dumping any output to stdout). + (void) errorOutWithMessage: (NSString *)theMessage; @end biococoa-2.2.2/BCFoundation/BCUtils/BCUtilCGI.m000644 000765 000024 00000007522 10404057133 021403 0ustar00scottcstaff000000 000000 // // BCUtilCGI.m // BioCocoa // // Created by John Timmer on Fri Jul 30 2004. // Copyright (c) 2004 The BioCocoa Project. All rights reserved. // #import "BCUtilCGI.h" #import "BCUtilStrings.h" @implementation BCUtilCGI + (NSDictionary *) retrieveFormData { // first, we find out if we received information from a "get" or a "post" // get places its information in the "QUERY_STRING" environment variable. NSDictionary *theEnvironment = [[NSProcessInfo processInfo] environment]; NSString *rawData = [theEnvironment objectForKey: @"QUERY_STRING"]; if ( rawData == nil || [rawData length] == 0 ) { // if it's equal to nil, then we've received our data from a "post" form // in this case, the data's been sent to stdin, and the environment variable // "CONTENT_LENGTH" tells us how much data's there. NSNumber *theLength = [theEnvironment objectForKey: @"CONTENT_LENGTH"]; if ( theLength == nil || [theLength intValue] == 0 ) return nil; NSFileHandle *inputReader = [NSFileHandle fileHandleWithStandardInput]; NSData *tempData; ////////////////////////////////////////////////////////////////////////////////// // WARNING - it may be possible for stdin's buffer to fill and the app stall // in which case we'll try to read more than we can here ////////////////////////////////////////////////////////////////////////////////// tempData = [inputReader readDataOfLength: [theLength intValue]]; [inputReader closeFile]; rawData= [[[NSString alloc] initWithData: tempData encoding: NSUTF8StringEncoding] autorelease]; } if ( rawData == nil || [rawData length] == 0 ) return nil; rawData = [rawData stringByAddingURLEscapesUsingEncoding: NSISOLatin1StringEncoding]; NSMutableDictionary *theReturn = [NSMutableDictionary dictionary]; NSArray *theEntries = [rawData componentsSeparatedByString: @"&"]; // check to see if the separator is a ; instead // if there is only one form element, the second method will return the same thing // as the first, so no harm done. if ( [theEntries count] == 1 ) theEntries = [rawData componentsSeparatedByString: @";"]; NSEnumerator *entryEnumerator = [theEntries objectEnumerator]; NSString *anEntry, *tempKey, *tempValue; NSRange equalLocation; while ( anEntry = [entryEnumerator nextObject] ) { equalLocation = [anEntry rangeOfString: @"="]; tempKey = [anEntry substringToIndex: equalLocation.location]; // see if the location is the last character in the string. if ( equalLocation.location == [anEntry length] - 1 ) [theReturn setObject: @"" forKey: tempKey]; else { tempKey = [anEntry substringToIndex: equalLocation.location]; tempValue = [anEntry substringFromIndex: equalLocation.location + 1]; [theReturn setObject: tempValue forKey: tempKey]; } } // we promised a non-mutable dictionary, so that's what we'll send return [[theReturn copy] autorelease]; } + (void) errorOutWithMessage: (NSString *)theMessage { // we simply stick the message between some necessary formatting for HTML output NSString *someOutput = @"Content-type: text/html\n\n\n\n

"; someOutput = [someOutput stringByAppendingString: theMessage]; someOutput = [someOutput stringByAppendingString : @"

"]; // create data from it and send it to stdout NSFileHandle *outHandle = [NSFileHandle fileHandleWithStandardOutput]; NSData *writeBytes = [NSData dataWithBytes: [someOutput UTF8String] length: [someOutput length]]; [outHandle writeData: writeBytes]; [outHandle closeFile]; } @end biococoa-2.2.2/BCFoundation/BCUtils/BCUtilData.h000644 000765 000024 00000003443 11223237412 021643 0ustar00scottcstaff000000 000000 // // BCUtilData.h // BioCocoa // // Created by Koen van der Drift on 7/22/2005. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Category methods for NSData. */ #import /*! @category NSData(DataAdditions) @abstract Parsing and utility methods */ @interface NSData (DataAdditions) - (unsigned char) charAtIndex: (int) index; @end biococoa-2.2.2/BCFoundation/BCUtils/BCUtilData.m000644 000765 000024 00000003343 11223237412 021647 0ustar00scottcstaff000000 000000 // // BCUtilData.m // BioCocoa // // Created by Koen van der Drift on 7/22/2005. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCUtilData.h" @implementation NSData (DataAdditions) - (unsigned char) charAtIndex: (int) index { const char *buffer = (const char *)[self bytes]; return buffer[index]; } @end biococoa-2.2.2/BCFoundation/BCUtils/BCUtilStringDNA.h000644 000765 000024 00000004135 10404057133 022562 0ustar00scottcstaff000000 000000 // // BCUtilStringDNA.h // // Created by John Timmer on Fri Jul 16 2004. // Copyright (c) 2004 The BioCocoa Project. All rights reserved. // #import @interface BCUtilStringDNA : NSObject { NSDictionary *baseComplements; NSCharacterSet *strictBaseSet; NSCharacterSet *normalBaseSet; NSCharacterSet *looseBaseSet; NSDictionary *basesAndReplacements; } ////////////////////////////////////////////////////////////////////////////////// // A note on usage - // Most of these methods require the use of character sets and dictionaries. // To save a bit of energy, we create a single shared instance, so we only make // them once. Use "sharedDNAUtilObject" to get it. ////////////////////////////////////////////////////////////////////////////////// // creation of this object - (BCUtilStringDNA *) init; + (BCUtilStringDNA *) sharedDNAUtilObject; ////////////////////////////////////////////////////////////////////////////////// // A note on the strings returned - // These methods handle differences in case by uppercasing everything, so the // string returned will be uppercase. // This should be an invitation for someone to write a case preserving version! ////////////////////////////////////////////////////////////////////////////////// // handling the composition of a string in terms of valid DNA characters // the strict methods allow ATCGN // the others allow the full spectrum: ATCGNMKRYWSHVDB - (BOOL) hasNonDNACharacters: (NSString *)entry; - (BOOL) hasNonDNACharacters_Strict: (NSString *)entry; - (NSString *) stripNonDNACharacters: (NSString *)entry; - (NSString *) stripNonDNACharacters_Strict: (NSString *)entry; // complementing DNA sequences - (NSString *) complementOfSequence: (NSString *)entry; - (NSString *) reverseComplementOfSequence: (NSString *)entry; // building a list of all possible sequences from a sequence with ambiguous bases - (NSArray *) getAllSitesForSequence: (NSString *) entry; // finding ORFs - (NSRange) findLongestORFInSequence: (NSString *)entry startingWithATG: (BOOL)atgStart inBothDirections: (BOOL)bothDirections; @end biococoa-2.2.2/BCFoundation/BCUtils/BCUtilStringDNA.m000644 000765 000024 00000052445 10404057133 022576 0ustar00scottcstaff000000 000000 // // BCUtilStringDNA.m // BioCocoa // // Created by John Timmer on Fri Jul 16 2004. // Copyright (c) 2004 The BioCocoa Project. All rights reserved. // #import "BCUtilStringDNA.h" @implementation BCUtilStringDNA static BCUtilStringDNA *sharedDNASequenceObject = nil; // we create a bunch of objects at allocation so that we don't waste time // and memory every time we call a method - (BCUtilStringDNA *) init { self = [super init]; if ( !self ) return nil; // create a dictionary of the corresponding bases NSMutableDictionary *complementaryBases = [NSMutableDictionary dictionary]; [complementaryBases setObject: @"G" forKey: @"C"]; [complementaryBases setObject: @"C" forKey: @"G"]; [complementaryBases setObject: @"A" forKey: @"T"]; [complementaryBases setObject: @"T" forKey: @"A"]; [complementaryBases setObject: @"R" forKey: @"Y"]; [complementaryBases setObject: @"Y" forKey: @"R"]; [complementaryBases setObject: @"M" forKey: @"K"]; [complementaryBases setObject: @"K" forKey: @"M"]; [complementaryBases setObject: @"W" forKey: @"S"]; [complementaryBases setObject: @"S" forKey: @"W"]; [complementaryBases setObject: @"H" forKey: @"D"]; [complementaryBases setObject: @"D" forKey: @"H"]; [complementaryBases setObject: @"V" forKey: @"B"]; [complementaryBases setObject: @"B" forKey: @"V"]; [complementaryBases setObject: @"N" forKey: @"N"]; baseComplements = [complementaryBases copy]; // generate a few character sets // we use all caps here and uppercase anything we get sent normalBaseSet = [[NSCharacterSet characterSetWithCharactersInString: @"ATCG"] retain]; strictBaseSet = [[NSCharacterSet characterSetWithCharactersInString: @"GATCN"] retain]; looseBaseSet = [[NSCharacterSet characterSetWithCharactersInString: @"GATCNMKRYWSHVDB"] retain]; // this is used to return the full list of bases when given a single letter that // represents more than one base basesAndReplacements = [NSDictionary dictionaryWithObjects: [NSArray arrayWithObjects: @"CA", @"GT", @"AG", @"CT", @"AT", @"GC", @"ACT", @"ACG", @"AGT", @"CGT", @"ACGT", nil] forKeys: [NSArray arrayWithObjects: @"M", @"K" , @"R", @"Y", @"W", @"S", @"H", @"V", @"D", @"B", @"N", nil] ]; [basesAndReplacements retain]; return self; } // preferred method for obtaining this object. + (BCUtilStringDNA *)sharedDNAUtilObject { if (sharedDNASequenceObject == nil) sharedDNASequenceObject = [[BCUtilStringDNA alloc] init]; return sharedDNASequenceObject; } // the strict method allows ATCGN - (NSString *) stripNonDNACharacters_Strict: (NSString *)entry { NSMutableString *theReturn = [NSMutableString stringWithString: @""]; NSString *tempString = nil; NSScanner *validBaseScanner = [NSScanner scannerWithString: [entry uppercaseString]]; while ( ![validBaseScanner isAtEnd] ) { // grab valid characters and add them to the string to be used if ( [validBaseScanner scanCharactersFromSet: strictBaseSet intoString: &tempString] ) [theReturn appendString: tempString]; // move the scanner's index forward to the next valid character else [validBaseScanner scanUpToCharactersFromSet: strictBaseSet intoString: nil]; } return [[theReturn copy] autorelease]; } // This method allows the full spectrum of possible nucleotides: ATCGNMKRYWSHVDB - (NSString *) stripNonDNACharacters: (NSString *)entry { NSMutableString *theReturn = [NSMutableString stringWithString: @""]; NSString *tempString = nil; NSScanner *validBaseScanner = [NSScanner scannerWithString: [entry uppercaseString]]; while ( ![validBaseScanner isAtEnd] ) { // grab valid characters and add them to the string to be used if ( [validBaseScanner scanCharactersFromSet: looseBaseSet intoString: &tempString] ) [theReturn appendString: tempString]; // move the scanner's index forward to the next valid character else [validBaseScanner scanUpToCharactersFromSet: looseBaseSet intoString: nil]; } return [[theReturn copy] autorelease]; } // Useful for pasted sequences or file reads - determines whether things need to be stripped out // before using a sequence string for analysis. - (BOOL) hasNonDNACharacters_Strict: (NSString *)entry { if ( [strictBaseSet isSupersetOfSet: [NSCharacterSet characterSetWithCharactersInString: [entry uppercaseString]]] ) return NO; return YES; } - (BOOL) hasNonDNACharacters: (NSString *)entry { if ( [looseBaseSet isSupersetOfSet: [NSCharacterSet characterSetWithCharactersInString: [entry uppercaseString]]] ) return NO; return YES; } // Complement and reverse complement should be self explanatory - (NSString *) complementOfSequence: (NSString *)entry { NSString *sequenceString = [entry uppercaseString]; NSMutableString *theReturn = [NSMutableString stringWithString: @""]; NSString *aBaseString; int loopCounter; for (loopCounter = 0; loopCounter < [sequenceString length]; loopCounter++ ) { aBaseString = [sequenceString substringWithRange: NSMakeRange( loopCounter, 1) ]; [theReturn appendString: [baseComplements objectForKey: aBaseString]]; } return theReturn; } - (NSString *) reverseComplementOfSequence: (NSString *)entry { NSString *sequenceString = [entry uppercaseString]; NSMutableString *theReturn = [NSMutableString stringWithString: @""]; NSString *aBaseString; int loopCounter; for (loopCounter = 0; loopCounter < [sequenceString length]; loopCounter++ ) { aBaseString = [sequenceString substringWithRange: NSMakeRange( loopCounter, 1) ]; [theReturn insertString: [baseComplements objectForKey: aBaseString] atIndex: 0]; } return theReturn; } // given an ambiguous (but valid) sequence such as ATRNYGG, this will return an array // where each entry represents a possible equivalent sequence using only ATCG. - (NSArray *) getAllSitesForSequence: (NSString *) entry { // we build up an array of possible sites, one base at a time. int loopCounter, innerLoopCounter; unsigned char aBase; NSString *aBaseString, *tempString, *theReplacements; NSString *theSequence = [entry uppercaseString]; NSEnumerator *theArrayEnumerator; NSMutableArray *tempArray; NSMutableArray *theReturn = [NSMutableArray arrayWithObject: [NSMutableString stringWithString: @""]]; for (loopCounter = 0; loopCounter < [theSequence length]; loopCounter++ ) { // we need both the char and the string for different reasons aBase = [theSequence characterAtIndex: loopCounter]; aBaseString = [theSequence substringWithRange: NSMakeRange( loopCounter, 1) ]; // first case - a regular base that we can tack on if ( [normalBaseSet characterIsMember: aBase] ) { for (innerLoopCounter = 0; innerLoopCounter < [theReturn count]; innerLoopCounter++ ) { [theReturn replaceObjectAtIndex: innerLoopCounter withObject: [[theReturn objectAtIndex: innerLoopCounter] stringByAppendingString: aBaseString] ]; } } // we append a number of bases, depending on what the character is, expanding the array to handle // all the options. else { tempArray = [NSMutableArray array]; theArrayEnumerator = [theReturn objectEnumerator]; theReplacements = [basesAndReplacements objectForKey: aBaseString]; while ( tempString = [theArrayEnumerator nextObject] ) { for (innerLoopCounter = 0; innerLoopCounter < [theReplacements length]; innerLoopCounter++ ) { [tempArray addObject: [tempString stringByAppendingString: [theReplacements substringWithRange: NSMakeRange( innerLoopCounter, 1) ] ]]; } } theReturn = tempArray; } } return theReturn; } - (NSRange) findLongestORFInSequence: (NSString *)entry startingWithATG: (BOOL)atgStart inBothDirections: (BOOL)bothDirections { int currentORFStartLocation = -1; int currentORFLength = 0; int maxORFStartLocation = 0; int maxORFLength = 0; int outerLoopCounter, innerLoopCounter, currentCodonStart; NSString *aCodon; NSCharacterSet *aCodonsBases; // set up some values to check against NSSet *stopCodonSet = [NSSet setWithObjects: @"TAA", @"TAG", @"TGA", nil]; NSSet *reversedStopCodonSet = [NSSet setWithObjects: @"TTA", @"CTA", @"TCA", nil]; // to simplify searches, we capitalize the string NSString *theSequence = [entry uppercaseString]; // Now that we have our copies, we can analyze the sequence //////////////////////////////////////// // Two possible ways to analyze - one with a ATG start // one with any ORF // // this one is the ATG start //////////////////////////////////////// if ( atgStart ) { NSRange currentATGRange; // we'll do this once forward and (possibly) once reverse - this is the forward currentATGRange = [theSequence rangeOfString: @"ATG"]; while ( currentATGRange.location != NSNotFound ) { currentORFStartLocation = currentATGRange.location; currentORFLength = 3; innerLoopCounter = currentORFStartLocation + 3; while ( innerLoopCounter + 3 < [theSequence length] ) { // find the closest stop codon aCodon = [theSequence substringWithRange: NSMakeRange( innerLoopCounter, 3 ) ]; // if the sequence is ambiguous, we call an end to any open ORFs aCodonsBases = [NSCharacterSet characterSetWithCharactersInString: aCodon]; if ( ![strictBaseSet isSupersetOfSet: aCodonsBases] ) { // see if we've got the longest one yet if ( currentORFLength > maxORFLength ) { maxORFLength = currentORFLength - 1; maxORFStartLocation = currentORFStartLocation; } // now, reset our values currentORFLength = 0; currentORFStartLocation = -1; break; } // do the same thing if it's a stop codon else if ( [stopCodonSet containsObject: aCodon] ) { // see if we've got the longest one yet if ( currentORFLength > maxORFLength ) { maxORFLength = currentORFLength - 1; maxORFStartLocation = currentORFStartLocation; } // now, reset our values currentORFLength = 0; currentORFStartLocation = -1; break; } // otherwise, we just keep going to the next codon currentORFLength = currentORFLength + 3; innerLoopCounter = innerLoopCounter + 3; } // the loop through the sequence has ended // we need to confirm that we haven't run off the far end of the sequence within an ORF if ( currentORFStartLocation != -1 ) { if ( currentORFLength > maxORFLength ) { maxORFLength = currentORFLength; maxORFStartLocation = currentORFStartLocation; } } // move on to the next ATG currentATGRange = [theSequence rangeOfString: @"ATG" options: NSCaseInsensitiveSearch range: NSMakeRange( currentATGRange.location + 1, [theSequence length] - currentATGRange.location - 2 ) ]; } if ( bothDirections ) { // we do everything in reverse, though the logic is largely the same currentATGRange = [theSequence rangeOfString: @"CAT" options: NSBackwardsSearch range: NSMakeRange( 0, [theSequence length]) ]; while ( currentATGRange.location != NSNotFound ) { currentORFStartLocation = currentATGRange.location; currentORFLength = 3; innerLoopCounter = currentORFStartLocation - 3; while ( innerLoopCounter - 3 > 0 ) { // find the closest stop codon aCodon = [theSequence substringWithRange: NSMakeRange( innerLoopCounter, 3 ) ]; // if the sequence is ambiguous, we call an end to any open ORFs aCodonsBases = [NSCharacterSet characterSetWithCharactersInString: aCodon]; if ( ![strictBaseSet isSupersetOfSet: aCodonsBases] ) { // see if we've got the longest one yet if ( currentORFLength > maxORFLength ) { maxORFLength = currentORFLength; // the start location is actually wrong, since it's the far end - we need the start maxORFStartLocation = currentORFStartLocation - currentORFLength + 2; } // now, reset our values currentORFLength = 0; currentORFStartLocation = -1; break; } // do the same thing if it's a stop codon else if ( [reversedStopCodonSet containsObject: aCodon] ) { // see if we've got the longest one yet if ( currentORFLength > maxORFLength ) { maxORFLength = currentORFLength; // the start location is actually wrong, since it's the far end - we need the start maxORFStartLocation = currentORFStartLocation - currentORFLength + 2; } // now, reset our values currentORFLength = 0; currentORFStartLocation = -1; break; } // otherwise, we just keep going to the next codon currentORFLength = currentORFLength + 3; innerLoopCounter = innerLoopCounter - 3; } // we need to confirm that we haven't run off the far end of the sequence within an ORF if ( currentORFStartLocation != -1 ) { if ( currentORFLength > maxORFLength ) { maxORFLength = currentORFLength; // the start location is actually wrong, since it's the far end - we need the start maxORFStartLocation = 0; } } currentATGRange = [theSequence rangeOfString: @"CAT" options: NSBackwardsSearch range: NSMakeRange( 0, currentATGRange.location) ]; } } } //////////////////////////////////////// // ORFs without an ATG found here //////////////////////////////////////// else { // we'll do this once forward and once reverse - this is the forward for ( outerLoopCounter=0; outerLoopCounter < 3; outerLoopCounter++ ) { // we miss the very last codon this way, but it's an acceptable risk, since it'll mostly be low quality trace for (innerLoopCounter = 0; innerLoopCounter < (([theSequence length] / 3) - 1); innerLoopCounter++ ) { currentCodonStart = innerLoopCounter * 3 + outerLoopCounter; aCodon = [theSequence substringWithRange: NSMakeRange( currentCodonStart, 3 ) ]; // if the sequence is ambiguous, we skip it and call an end to any open ORFs aCodonsBases = [NSCharacterSet characterSetWithCharactersInString: aCodon]; if ( ![strictBaseSet isSupersetOfSet: aCodonsBases] ) { // see if we've got the longest one yet if ( currentORFLength > maxORFLength ) { maxORFLength = currentORFLength - 1; maxORFStartLocation = currentORFStartLocation; } // now, reset our values currentORFLength = 0; currentORFStartLocation = -1; } // do the same thing if it's a stop codon else if ( [stopCodonSet containsObject: aCodon] ) { // see if we've got the longest one yet if ( currentORFLength > maxORFLength ) { maxORFLength = currentORFLength - 1; maxORFStartLocation = currentORFStartLocation; } // now, reset our values currentORFLength = 0; currentORFStartLocation = -1; } // must have a plain old codon else { // two choices - starting an ORF, or continuing it if ( currentORFStartLocation == -1 ) { // start a new one currentORFStartLocation = currentCodonStart; currentORFLength = 3; } else { currentORFLength = currentORFLength + 3; } } } // we've finished a pass of the inner loop (a run through of one reading frame // see if the ORF is still open if ( currentORFLength > maxORFLength ) { maxORFLength = currentORFLength; maxORFStartLocation = currentORFStartLocation; } // reset the values currentORFLength = 0; currentORFStartLocation = -1; } ////////////////////////////////////////////////// // do it over again, looking for the reverse of stop codons. ////////////////////////////////////////////////// if ( bothDirections ) { for ( outerLoopCounter=0; outerLoopCounter < 3; outerLoopCounter++ ) { // we miss the very last codon this way, but it's an acceptable risk, since it'll mostly be low quality trace for (innerLoopCounter = 0; innerLoopCounter < (([theSequence length] / 3) - 1); innerLoopCounter++ ) { currentCodonStart = innerLoopCounter * 3 + outerLoopCounter; aCodon = [theSequence substringWithRange: NSMakeRange( currentCodonStart, 3 ) ]; // if the sequence is ambiguous, we skip it and call an end to any open ORFs aCodonsBases = [NSCharacterSet characterSetWithCharactersInString: aCodon]; if ( ![strictBaseSet isSupersetOfSet: aCodonsBases] ) { // see if we've got the longest one yet if ( currentORFLength > maxORFLength ) { maxORFLength = currentORFLength - 1; maxORFStartLocation = currentORFStartLocation; } // now, reset our values currentORFLength = 0; currentORFStartLocation = - 1; } // do the same thing if it's a stop codon else if ( [reversedStopCodonSet containsObject: aCodon] ) { // see if we've got the longest one yet if ( currentORFLength > maxORFLength ) { maxORFLength = currentORFLength - 1; maxORFStartLocation = currentORFStartLocation; } // now, reset our values currentORFLength = 0; currentORFStartLocation = - 1; } // must have a plain old codon else { // two choices - starting an ORF, or continuing it if ( currentORFStartLocation == -1 ) { // start a new one currentORFStartLocation = currentCodonStart; currentORFLength = 3; } else { currentORFLength = currentORFLength + 3; } } } // we've finished a pass of the inner loop (a run through of one reading frame // see if the ORF is still open if ( currentORFLength > maxORFLength ) { maxORFLength = currentORFLength; maxORFStartLocation = currentORFStartLocation; } // reset the values currentORFLength = 0; currentORFStartLocation = -1; } } } ///////// WE'RE DONE! ////////////////// return NSMakeRange( maxORFStartLocation, maxORFLength); } @end biococoa-2.2.2/BCFoundation/BCUtils/BCUtilStrings.h000644 000765 000024 00000006212 11223237412 022420 0ustar00scottcstaff000000 000000 // // BCUtilStrings.h // was stringAdditions // // Created by Peter Schols on Wed Oct 22 2003. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Category methods for NSString and NSMutableString. */ #import /*! @category NSString(StringAdditions) @abstract Parsing and utility methods */ @interface NSString (StringAdditions) -(BOOL)hasCaseInsensitivePrefix:(NSString *)prefix; -(BOOL)hasCaseInsensitiveSuffix:(NSString *)suffix; -(NSString *)stringByReplacingSpaceWithUnderscore; #ifndef GNUSTEP -(NSString *)stringByAddingURLEscapesUsingEncoding: (CFStringEncodings) enc; #endif +(NSString *)stringWithBytes:(const void *)bytes length: (unsigned)length encoding: (NSStringEncoding) encoding; -(BOOL)stringContainsString:(NSString *)s; -(BOOL)stringContainsCharactersFromString:(NSString *)s; -(BOOL)stringContainsCharactersFromSet:(NSCharacterSet *)set; //-(NSString *)stringByRemovingRichTextFromString:(NSString *)inputString -(BOOL)stringBeginsWithTwoNumbers; -(NSMutableArray *)splitLines; - (NSString *)stringByRemovingWhitespace; - (NSString *)stringByRemovingWhitespaceAndNewline; - (NSString *)stringByRemovingCharactersFromSet:(NSCharacterSet *)set; - (NSString *) bracketedStringWithLeftBracket: (NSString *)leftBracket rightBracket: (NSString *)rightBracket caseSensitive: (BOOL)caseSensitive; - (NSString *) addSpacesToStringWithInterval:(int)interval; - (NSString *) addSpacesToStringWithInterval:(int)interval removeOldWhitespaces:(BOOL)remove; - (NSMutableString *)convertLineBreaksToMac; @end /*! @category NSMutableString(StringAdditions) @abstract Parsing and utility methods */ @interface NSMutableString (StringAdditions) - (void)removeCharactersInSet:(NSCharacterSet *)set; @end biococoa-2.2.2/BCFoundation/BCUtils/BCUtilStrings.m000644 000765 000024 00000022212 11455660036 022434 0ustar00scottcstaff000000 000000 // // BCUtilStrings.m // was StringAdditions.m // // Created by Peter Schols on Wed Oct 22 2003. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCUtilStrings.h" @implementation NSString (StringAdditions) +(NSString *)stringWithBytes:(const void *)bytes length: (unsigned)length encoding: (NSStringEncoding) encoding { return [[[NSString alloc] initWithBytes: bytes length: length encoding: encoding] autorelease]; } -(BOOL)hasCaseInsensitivePrefix:(NSString *)prefix { return [self rangeOfString: prefix options: (NSCaseInsensitiveSearch | NSAnchoredSearch) range: NSMakeRange(0, [prefix length])].location != NSNotFound; } -(BOOL)hasCaseInsensitiveSuffix:(NSString *)suffix { return [self rangeOfString: suffix options: (NSCaseInsensitiveSearch | NSAnchoredSearch) range: NSMakeRange(0, [suffix length])].location != NSNotFound; } -(NSString *)stringByReplacingSpaceWithUnderscore { NSMutableString *ms = [NSMutableString stringWithString:self]; [ms replaceOccurrencesOfString:@" " withString:@"_" options:0 range:NSMakeRange(0, [self length])]; return ms; } #ifndef GNUSTEP -(NSString *)stringByAddingURLEscapesUsingEncoding: (CFStringEncodings) enc { NSString* str2 = (id) CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)self, nil, nil, enc); if( str2 == self ) [self release]; // CF just bumped its refcount else [str2 autorelease]; return str2; } #endif -(BOOL)stringContainsString:(NSString *)s { NSRange aRange; aRange = [self rangeOfString:s]; return (aRange.location != NSNotFound); } -(BOOL)stringContainsCharactersFromString:(NSString *)s { NSCharacterSet *set = [NSCharacterSet characterSetWithCharactersInString: s]; return [self stringContainsCharactersFromSet: set]; } -(BOOL)stringContainsCharactersFromSet:(NSCharacterSet *)set { return ( [self rangeOfCharacterFromSet: set].location != NSNotFound ); } -(BOOL)stringBeginsWithTwoNumbers { NSScanner *scanner = [NSScanner scannerWithString: self]; if ([scanner scanInt:nil]) { if ([scanner scanInt:nil]) return YES; else return NO; } else return NO; } -(NSMutableArray *)splitLines { NSMutableArray *arrayOfLines = [[NSMutableArray alloc] init]; /* unsigned start; unsigned stringLength = [self length]; NSRange lineRange = NSMakeRange(0, 0); NSRange searchRange = NSMakeRange(0, 0); while ( searchRange.location < stringLength ) { [self getLineStart:&start end: &searchRange.location contentsEnd: &end forRange: searchRange]; lineRange.length = searchRange.location - lineRange.location; [arrayOfLines addObject:[self substringWithRange: lineRange]]; lineRange.location = searchRange.location; } */ NSUInteger start, end, next, stringLength; NSRange range; stringLength = [self length]; range.location = 0; range.length = 1; do { [self getLineStart:&start end:&next contentsEnd:&end forRange:range]; range.location = start; range.length = end-start; [arrayOfLines addObject: [self substringWithRange:range]]; range.location = next; range.length = 1; } while (next < stringLength); return [arrayOfLines autorelease]; } - (NSString *)stringByRemovingWhitespace { return [self stringByRemovingCharactersFromSet:[NSCharacterSet whitespaceCharacterSet]]; } - (NSString *)stringByRemovingWhitespaceAndNewline { return [self stringByRemovingCharactersFromSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; } - (NSString *)stringByRemovingCharactersFromSet:(NSCharacterSet *)set { NSMutableString *temp; if ( [self rangeOfCharacterFromSet:set options: NSLiteralSearch].length == 0 ) return self; temp = [[self mutableCopyWithZone:[self zone]] autorelease]; [temp removeCharactersInSet:set]; return temp; } //- (NSString *) stringByRemovingRichTextFromString: (NSString *) inputString //{ // if ([inputString hasCaseInsensitivePrefix: @"{\\rtf1"]) // { // NSAttributedString *rtfstring = [[NSAttributedString alloc]initWithRTF: inputString documentAttributes: nil]; // inputString = [rtfstring string]; // [rtfstring release]; // } // // return inputString; //} - (NSString *) bracketedStringWithLeftBracket: (NSString *)leftBracket rightBracket: (NSString *)rightBracket caseSensitive: (BOOL)caseSensitive { if ( caseSensitive ) { NSRange startRange = [self rangeOfString: leftBracket]; if ( startRange.location == NSNotFound ) return nil; int startPosition = startRange.location + startRange.length; NSRange endRange = [self rangeOfString: rightBracket options: 0 range: NSMakeRange(startPosition, ([self length] - startPosition))]; if ( endRange.location == NSNotFound ) return nil; if ( startPosition >= endRange.location ) return @""; return [self substringWithRange: NSMakeRange( startPosition, endRange.location - startPosition) ]; } else { NSRange startRange = [self rangeOfString: leftBracket options: NSCaseInsensitiveSearch]; if ( startRange.location == NSNotFound ) return nil; int startPosition = startRange.location + startRange.length; NSRange endRange = [self rangeOfString: rightBracket options: NSCaseInsensitiveSearch range: NSMakeRange(startPosition, ([self length] - startPosition))]; if ( endRange.location == NSNotFound ) return nil; if ( startPosition >= endRange.location ) return @""; return [self substringWithRange: NSMakeRange( startPosition, endRange.location - startPosition) ]; } return nil; } - (NSString *)addSpacesToStringWithInterval:(int)interval { return [self addSpacesToStringWithInterval: interval removeOldWhitespaces:NO]; } - (NSString *)addSpacesToStringWithInterval:(int)interval removeOldWhitespaces:(BOOL)remove { NSMutableString *newString; int i; if ( remove ) self = [self stringByRemovingWhitespace]; newString = [[self mutableCopy] autorelease]; i = [ newString length ] - 1; while ( i > 0 ) { if ( i % interval == 0 ) { [newString insertString: @" " atIndex:i]; i -= interval; } else i--; } return newString; } - (NSMutableString *)convertLineBreaksToMac { // \r\n (Windows) becomes \r\r - \n (Unix) becomes \r NSMutableString *theString = [[NSMutableString alloc] initWithString: self]; [theString replaceOccurrencesOfString:@"\r\n" withString:@"\r" options:0 range:NSMakeRange(0, [theString length])]; [theString replaceOccurrencesOfString:@"\n" withString:@"\r" options:0 range:NSMakeRange(0, [theString length])]; return [theString autorelease]; } @end @implementation NSMutableString(StringAdditions) - (void)removeCharactersInSet:(NSCharacterSet *)set { NSRange matchRange, searchRange, replaceRange; unsigned int length; length = [self length]; matchRange = [self rangeOfCharacterFromSet:set options:NSLiteralSearch range:NSMakeRange(0, length)]; while(matchRange.length > 0) { replaceRange = matchRange; searchRange.location = NSMaxRange(replaceRange); searchRange.length = length - searchRange.location; for(;;) { matchRange = [self rangeOfCharacterFromSet:set options:NSLiteralSearch range:searchRange]; if((matchRange.length == 0) || (matchRange.location != searchRange.location)) break; replaceRange.length += matchRange.length; searchRange.length -= matchRange.length; searchRange.location += matchRange.length; } [self deleteCharactersInRange:replaceRange]; matchRange.location -= replaceRange.length; length -= replaceRange.length; } } @end biococoa-2.2.2/BCFoundation/BCUtils/GNUmakefile000644 000765 000024 00000003716 11226023231 021626 0ustar00scottcstaff000000 000000 # # GNUmakefile # # Written by: Scott Christley # Copyright (c) 2003-2009 The BioCocoa Project. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # include $(GNUSTEP_MAKEFILES)/common.make # The library to be compiled SUBPROJECT_NAME = BCUtils # The Objective-C source files to be compiled BCUtils_OBJC_FILES = \ BCDataMatrix.m \ BCUtilData.m \ BCUtilStrings.m # The header files BCUtils_HEADER_FILES = \ BCDataMatrix.h \ BCUtilData.h \ BCUtilStrings.h BIOCOCOA_BASE_DIR = .. -include $(BIOCOCOA_BASE_DIR)/GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble biococoa-2.2.2/BCFoundation/BCTools/BCSequenceTool.h000644 000765 000024 00000003463 11223237412 022544 0ustar00scottcstaff000000 000000 // // BCSequenceTool.h // BioCocoa // // Created by Koen van der Drift on 12/17/2004. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import #import "BCFoundationDefines.h" @class BCSequence; @interface BCSequenceTool : NSObject { BCSequence *sequence; } - (id) initWithSequence: (BCSequence *)list; - (BCSequence *)sequence; - (void)setSequence:(BCSequence *)s; @end biococoa-2.2.2/BCFoundation/BCTools/BCSequenceTool.m000644 000765 000024 00000003714 11223237412 022550 0ustar00scottcstaff000000 000000 // // BCSequenceTool.m // BioCocoa // // Created by Koen van der Drift on 12/17/2004. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCSequenceTool.h" #import "BCSequence.h" @implementation BCSequenceTool -(id) initWithSequence:(BCSequence *)list { if ( (self = [super init]) ) { [self setSequence: list]; } return self; } -(void)dealloc { [sequence release]; [super dealloc]; } - (BCSequence *)sequence { return sequence; } - (void)setSequence:(BCSequence *)s { [s retain]; [sequence release]; sequence = s; } @end biococoa-2.2.2/BCFoundation/BCTools/BCToolComplement.h000644 000765 000024 00000003534 11223237412 023076 0ustar00scottcstaff000000 000000 // // BCToolComplement.h // BioCocoa // // Created by Koen van der Drift on 11/19/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import #import "BCSequenceTool.h" @class BCSequence, BCSymbol; @interface BCToolComplement : BCSequenceTool { BOOL reverse; } + (BCToolComplement *) complementToolWithSequence: (BCSequence *)list; - (void)setReverse: (BOOL)value; - (BCSequence *) sequenceComplement; @end biococoa-2.2.2/BCFoundation/BCTools/BCToolComplement.m000644 000765 000024 00000006450 11223237412 023103 0ustar00scottcstaff000000 000000 // // BCToolComplement.m // BioCocoa // // Created by Koen van der Drift on 11/19/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCToolComplement.h" #import "BCSequence.h" #import "BCSymbol.h" #import "BCNucleotide.h" #import "BCFoundationDefines.h" #import "BCInternal.h" @implementation BCToolComplement -(id) initWithSequence:(BCSequence *)list { if ( (self = [super initWithSequence:list]) ) { [self setReverse: NO]; } return self; } + (BCToolComplement *) complementToolWithSequence: (BCSequence *) list { BCToolComplement *complementTool = [[BCToolComplement alloc] initWithSequence: list]; return [complementTool autorelease]; } - (void)setReverse: (BOOL)value { reverse = value; } - (BCSequence *) sequenceComplement { BCNucleotide *symbol; NSArray *symbolArray; NSMutableArray *theComplement; DECLARE_INDEX(loopCounter); int theLimit, newLocation; BCSymbol *symbolComplement; // if it's a protein, we return the same sequence. // why a negative test here? It could also be BCSequenceTypeCodon or BCSequenceTypeOther. // maybe we should test for BCSequenceTypeProtein ? if ( [sequence sequenceType] != BCSequenceTypeDNA && [sequence sequenceType] != BCSequenceTypeRNA ) return [[sequence copy] autorelease]; symbolArray = [[self sequence] symbolArray]; theComplement = [NSMutableArray array]; theLimit = [symbolArray count]; for ( loopCounter = 0 ; loopCounter < theLimit ; loopCounter++ ) { symbol = (id)ARRAY_GET_VALUE_AT_INDEX(symbolArray, loopCounter); symbolComplement = [symbol complement]; if ( symbolComplement != nil ) { newLocation = ( reverse == NO ? loopCounter : 0 ); ARRAY_INSERT_VALUE_AT_INDEX(theComplement, newLocation, symbolComplement); } } return [BCSequence sequenceWithSymbolArray: theComplement symbolSet: [[self sequence] symbolSet]]; } @end biococoa-2.2.2/BCFoundation/BCTools/BCToolDigest.h000644 000765 000024 00000003416 11223237412 022211 0ustar00scottcstaff000000 000000 // // BCToolDigest.h // BioCocoa // // Created by Koen van der Drift on 2/26/05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import #import "BCSequenceTool.h" #import "BCFoundationDefines.h" @class BCSequence; @interface BCToolDigest : BCSequenceTool { } + (BCToolDigest *) digestToolWithSequence: (BCSequence *) aSequence; @end biococoa-2.2.2/BCFoundation/BCTools/BCToolDigest.m000644 000765 000024 00000003476 11223237412 022224 0ustar00scottcstaff000000 000000 // // BCToolDigest.m // BioCocoa // // Created by Koen van der Drift on 2/26/05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCToolDigest.h" #import "BCSequence.h" @implementation BCToolDigest + (BCToolDigest *) digestToolWithSequence: (BCSequence *) aSequence { BCToolDigest *digestTool = [[BCToolDigest alloc] initWithSequence: aSequence]; return [digestTool autorelease]; } @end biococoa-2.2.2/BCFoundation/BCTools/BCToolHydropathyCalculator.h000644 000765 000024 00000004145 11223237412 025137 0ustar00scottcstaff000000 000000 // // BCToolHydropathyCalculator.h // BioCocoa // // Created by Koen van der Drift on 4/30/2005. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import #import "BCSequenceTool.h" #import "BCFoundationDefines.h" @interface BCToolHydropathyCalculator : BCSequenceTool { BCHydropathyType hydropathyType; int slidingWindowSize; } + (BCToolHydropathyCalculator *) hydropathyCalculatorWithSequence: (BCSequence *) list; - (BCHydropathyType)hydropathyType; - (void)setHydropathyType:(BCHydropathyType)type; - (int)slidingWindowSize; - (void)setSlidingWindowSize:(int)newSize; -(NSArray *)calculateHydropathyForRange: (NSRange)aRange; -(NSArray *)calculateHydropathy; @end biococoa-2.2.2/BCFoundation/BCTools/BCToolHydropathyCalculator.m000644 000765 000024 00000006476 11223237412 025155 0ustar00scottcstaff000000 000000 // // BCToolHydropathyCalculator.m // BioCocoa // // Created by Koen van der Drift on 4/30/2005. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCToolHydropathyCalculator.h" #import "BCSequence.h" #import "BCAminoAcid.h" @implementation BCToolHydropathyCalculator + (BCToolHydropathyCalculator *) hydropathyCalculatorWithSequence: (BCSequence *) list { BCToolHydropathyCalculator *hydropathyCalculator = [[BCToolHydropathyCalculator alloc] initWithSequence: list]; [hydropathyCalculator setSlidingWindowSize: 1]; // default value return [hydropathyCalculator autorelease]; } - (BCHydropathyType)hydropathyType { return hydropathyType; } - (void)setHydropathyType:(BCHydropathyType)type { hydropathyType = type; } - (int)slidingWindowSize { return slidingWindowSize; } - (void)setSlidingWindowSize:(int)newSize { slidingWindowSize = newSize; } -(NSArray *)calculateHydropathy { return [self calculateHydropathyForRange: NSMakeRange(0, [[self sequence] length])]; } -(NSArray *)calculateHydropathyForRange: (NSRange)aRange { unsigned int len, start, i, j; BCAminoAcid *aa; NSMutableArray *tempArray = [NSMutableArray array]; // NSArray *sequenceArray = [[self sequence] symbolArray]; // CFIndex i, j; float sum; len = [[self sequence] length]; if ( len > 0 ) { start = aRange.location + 1; for ( i = 0; i < (len - [self slidingWindowSize]); i++ ) { sum = 0.0; for ( j = 0; j < [self slidingWindowSize]; j++ ) { // aa = (BCAminoAcid *)CFArrayGetValueAtIndex((CFArrayRef) sequenceArray, i+j ); // use NSData instead ? aa = (BCAminoAcid *) [[self sequence] symbolAtIndex: (i+j)]; sum += (hydropathyType == BCKyteDoolittle ? [aa kyteDoolittleValue] : [aa hoppWoodsValue]); } [tempArray addObject: NSStringFromPoint( NSMakePoint( (float) (start + i), (float) (sum / [self slidingWindowSize] ) ) ) ]; } } return [NSArray arrayWithArray: tempArray]; } @end biococoa-2.2.2/BCFoundation/BCTools/BCToolMassCalculator.h000644 000765 000024 00000005202 11223237412 023702 0ustar00scottcstaff000000 000000 // // BCToolMassCalculator.h // BioCocoa // // Created by Koen van der Drift on Wed Aug 25 2004. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Mass calculation for a sequence. */ #import #import "BCSequenceTool.h" #import "BCFoundationDefines.h" @class BCSymbol, BCSequence; /*! @class BCToolMassCalculator @abstract A wrapper class to calculate the mass of a sequence. @discussion This class can be used to calculate the mass of a BCSequence. * To use it simply pass any BCSequence object to the initializer or class method. * Then call the calculateMass: method. The class will * return an NSArray containing two numbers, the minimal mass and maximum mass. * This is needed to account for the possibility of having ambiguous symbols. * Use the method setMassType:(BCMassType)type to set if the calculated mass should be monoisotopic or average. * The default value is monoisotopic. */ @interface BCToolMassCalculator : BCSequenceTool { BCMassType massType; } + (BCToolMassCalculator *) massCalculatorWithSequence: (BCSequence *) list; - (void)setMassType:(BCMassType)type; - (NSArray *)calculateMass; - (NSArray *)calculateMassForRange: (NSRange)aRange; - (float) addWater; @end biococoa-2.2.2/BCFoundation/BCTools/BCToolMassCalculator.m000644 000765 000024 00000007337 11223237412 023722 0ustar00scottcstaff000000 000000 // // BCToolMassCalculator.m // BioCocoa // // Created by Koen van der Drift on Wed Aug 25 2004. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCToolMassCalculator.h" #import "BCToolSymbolCounter.h" #import "BCSequence.h" #import "BCSymbol.h" #import "BCFoundationDefines.h" @implementation BCToolMassCalculator -(id) initWithSequence:(BCSequence *)list { if ( (self = [super initWithSequence:list]) ) { [self setMassType: BCMonoisotopic]; } return self; } + (BCToolMassCalculator *) massCalculatorWithSequence: (BCSequence *)list { BCToolMassCalculator *massCalculator = [[BCToolMassCalculator alloc] initWithSequence: list]; return [massCalculator autorelease]; } - (void)setMassType:(BCMassType)type { massType = type; } -(NSArray *)calculateMass{ return [self calculateMassForRange: NSMakeRange(0, [[self sequence] length])]; } -(NSArray *)calculateMassForRange: (NSRange)aRange { float totalMin, totalMax; BCSymbol *aSymbol; totalMin = totalMax = 0.0; #if 1 unsigned symbolCount; BCToolSymbolCounter *symbolCounter = [BCToolSymbolCounter symbolCounterWithSequence: [self sequence]]; NSCountedSet *sequenceSet = [symbolCounter countSymbolsForRange: aRange]; NSEnumerator *objectEnumerator = [sequenceSet objectEnumerator]; while ( (aSymbol = [objectEnumerator nextObject]) ) { symbolCount = [sequenceSet countForObject: aSymbol]; totalMin += ((float)symbolCount * [aSymbol minMassUsingType: massType]); totalMax += ((float)symbolCount * [aSymbol maxMassUsingType: massType]); } #else CFIndex i; NSArray *array = [sequence symbolArray]; for ( i = 0; i < [array count]; i++ ) { aSymbol = (BCSymbol *)CFArrayGetValueAtIndex( (CFArrayRef) array, i); // use NSData instead ? totalMin += [aSymbol minMassUsingType: massType]; totalMax += [aSymbol maxMassUsingType: massType]; } #endif if ( totalMin ) { totalMin += [self addWater]; totalMax += [self addWater]; } return [NSArray arrayWithObjects: [NSNumber numberWithFloat:totalMin], [NSNumber numberWithFloat: totalMax], nil]; } -(float) addWater { // add water - cheers! if ( massType == BCMonoisotopic ) return 2 * hydrogenMonoisotopicMass + oxygenMonoisotopicMass; else if ( massType == BCAverage ) return 2 * hydrogenAverageMass + oxygenAverageMass; else return 0; } @end biococoa-2.2.2/BCFoundation/BCTools/BCToolSequenceFinder.h000644 000765 000024 00000005536 11223237412 023677 0ustar00scottcstaff000000 000000 // // BCToolSequenceFinder.h // BioCocoa // // Created by Koen van der Drift on 10/28/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Sequence searching. */ #import #import "BCSequenceTool.h" @class BCSequence, BCSymbol; /*! @class BCToolSequenceFinder @abstract A wrapper class to search a sequence @discussion This class can be used to search a sequence for a subsequence. * To use it simply pass any BCSequence object to the initializer or class method. * Then call the findSequence: method and pass the sequence to search for. The class will * return an NSArray containing NSRanges where all subsequences have been found. * The search can be influenced in two ways: * When the BOOL strict is set to NO, the search will include ambigous symbols * When the BOOL firstOnly is set to YES, only the first occurance of the subsequence is returned. */ @interface BCToolSequenceFinder : BCSequenceTool { BCSequence *searchSequence; NSRange searchRange; BOOL strict; BOOL firstOnly; } + (BCToolSequenceFinder *) sequenceFinderWithSequence: (BCSequence *)list; - (BCSequence *)searchSequence; - (void)setSearchSequence:(BCSequence *)list; - (NSRange)searchRange; - (void)setSearchRange:(NSRange)aRange; - (void)setStrict: (BOOL)value; - (void)setFirstOnly: (BOOL)value; - (BOOL)compareSymbol: (BCSymbol *)first withSymbol: (BCSymbol *) second; - (NSArray *)findSequence: (BCSequence *)entry; @end biococoa-2.2.2/BCFoundation/BCTools/BCToolSequenceFinder.m000644 000765 000024 00000020122 11223237412 023670 0ustar00scottcstaff000000 000000 // // BCToolSequenceFinder.m // BioCocoa // // Created by Koen van der Drift on 10/28/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCToolSequenceFinder.h" #import "BCSequence.h" #import "BCSymbol.h" #import "BCFoundationDefines.h" #import "BCInternal.h" @implementation BCToolSequenceFinder -(id) initWithSequence:(BCSequence *)list { if ( (self = [super initWithSequence:list]) ) { [self setStrict: YES]; [self setFirstOnly: YES]; searchSequence = [[BCSequence alloc] init]; searchRange = NSMakeRange( 0, [sequence length] ); } return self; } + (BCToolSequenceFinder *) sequenceFinderWithSequence: (BCSequence *) list { BCToolSequenceFinder *finder = [[BCToolSequenceFinder alloc] initWithSequence: list]; return [finder autorelease]; } -(void)dealloc { [searchSequence release]; [super dealloc]; } - (BCSequence *)searchSequence { return searchSequence; } - (void)setSearchSequence:(BCSequence *)s { [s retain]; [searchSequence release]; searchSequence = s; } - (NSRange)searchRange { return searchRange; } - (void)setSearchRange:(NSRange)aRange { searchRange = aRange; } - (void)setStrict: (BOOL)value { strict = value; } - (void)setFirstOnly: (BOOL)value { firstOnly = value; } - (BOOL)compareSymbol: (BCSymbol *)first withSymbol:(BCSymbol *) second { // We should think about a way to merge isEqualToSymbol and isRepresentedBySymbol // Maybe a method isRepresentedBySymbol, that is passed the value of 'strict' ? BOOL result = YES; if ( strict ) { result = [first isEqualToSymbol: second]; } else { result = [first isRepresentedBySymbol: second]; } return result; } - (NSArray *) findSequence: (BCSequence *)entry { BCSymbol *entrySymbol, *selfSymbol; DECLARE_INDEX(loopCounter); DECLARE_INDEX(innerCounter); BOOL haveMatch = NO; NSMutableArray *theReturn = [NSMutableArray array]; NSArray *symbolArray = [[self sequence] symbolArray]; NSArray *entryArray = [entry symbolArray]; // do bounds checking if ( searchRange.location + searchRange.length > [symbolArray count] ) { return theReturn; } // get the region to check NSArray *selfArray = [symbolArray subarrayWithRange: searchRange]; int aLimit = [selfArray count] - [entryArray count] + 1; int innerLimit = [entryArray count]; if ( strict ) { for ( loopCounter = 0; loopCounter < aLimit; loopCounter++ ) { selfSymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(selfArray, loopCounter); entrySymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(entryArray, 0); // scan through for a match at the first symbol if ( selfSymbol == entrySymbol ) { haveMatch = YES; innerCounter = 1; // go through and compare each symbol while ( innerCounter < innerLimit ) { selfSymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(selfArray, (loopCounter + innerCounter)); entrySymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(entryArray, innerCounter); if ( selfSymbol != entrySymbol ){ // exit without a match if we fail innerCounter = innerLimit; haveMatch = NO; } innerCounter ++; } // if we still have a match, we're good. if ( haveMatch ) { [theReturn addObject: [NSValue valueWithRange: NSMakeRange( loopCounter, [entry length] )]]; if ( firstOnly) return [[theReturn copy] autorelease]; } } } } else { for ( loopCounter = 0; loopCounter < aLimit; loopCounter++ ) { selfSymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(selfArray, loopCounter); entrySymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(entryArray, 0); // scan through for a match at the first symbol if ( [selfSymbol isRepresentedBySymbol: entrySymbol] || [entrySymbol isRepresentedBySymbol: selfSymbol] ) { haveMatch = YES; innerCounter = 1; // go through and compare each symbol while ( innerCounter < innerLimit ) { selfSymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(selfArray, (loopCounter + innerCounter)); entrySymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(entryArray, innerCounter); if ( ![selfSymbol isRepresentedBySymbol: entrySymbol] && ![entrySymbol isRepresentedBySymbol: selfSymbol] ){ // exit without a match if we fail innerCounter = innerLimit; haveMatch = NO; } innerCounter ++; } // if we still have a match, we're good. if ( haveMatch ) { [theReturn addObject: [NSValue valueWithRange: NSMakeRange( loopCounter, [entry length] )]]; if ( firstOnly) return [[theReturn copy] autorelease]; } } } } return [[theReturn copy] autorelease]; } - (NSArray *) slow_findSequence: (BCSequence *)entry { BCSymbol *entrySymbol, *selfSymbol; DECLARE_INDEX(loopCounter); DECLARE_INDEX(innerCounter); BOOL haveMatch = NO; NSMutableArray *theReturn = [NSMutableArray array]; NSArray *symbolArray = [[self sequence] symbolArray]; NSArray *entryArray = [entry symbolArray]; // do bounds checking if ( searchRange.location + searchRange.length > [symbolArray count] ) { return theReturn; } // get the region to check NSArray *selfArray = [symbolArray subarrayWithRange: searchRange]; int aLimit = [selfArray count] - [entryArray count] + 1; int innerLimit = [entryArray count]; for ( loopCounter = 0; loopCounter < aLimit; loopCounter++ ) { selfSymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(selfArray, loopCounter); entrySymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(entryArray, 0); // scan through for a match at the first symbol if ( [self compareSymbol: selfSymbol withSymbol:entrySymbol] || [self compareSymbol: entrySymbol withSymbol:selfSymbol] ) { haveMatch = YES; innerCounter = 1; // go through and compare each symbol while ( innerCounter < innerLimit ) { selfSymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(selfArray, (loopCounter + innerCounter)); entrySymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(entryArray, innerCounter); if ( ![self compareSymbol: selfSymbol withSymbol:entrySymbol] && ![self compareSymbol: entrySymbol withSymbol:selfSymbol]) { // exit without a match if we fail innerCounter = innerLimit; haveMatch = NO; } innerCounter ++; } // if we still have a match, we're good. if ( haveMatch ) { [theReturn addObject: [NSValue valueWithRange: NSMakeRange( loopCounter, [entry length] )]]; if ( firstOnly) return [[theReturn copy] autorelease]; } } } return [[theReturn copy] autorelease]; } @end biococoa-2.2.2/BCFoundation/BCTools/BCToolSymbolCounter.h000644 000765 000024 00000004427 11223237412 023602 0ustar00scottcstaff000000 000000 // // BCToolSymbolCounter.h // BioCocoa // // Created by Koen van der Drift on 10/27/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Symbol counting. */ #import #import "BCSequenceTool.h" /*! @class BCToolSymbolCounter @abstract A wrapper class to count each symbol in a symbollist @discussion This class can be used to count the number of occurances of each BCSymbol in a BCSequence. * To use it simply pass any BCSequence object to the initializer or class method. * Then call the countSymbols: method. The class will * return an NSCountedSet containing the number of each BCSymbol in the sequence. */ @interface BCToolSymbolCounter : BCSequenceTool { } + (BCToolSymbolCounter *) symbolCounterWithSequence: (BCSequence *)list; - (NSCountedSet *)countSymbols; - (NSCountedSet *)countSymbolsForRange: (NSRange)aRange; @end biococoa-2.2.2/BCFoundation/BCTools/BCToolSymbolCounter.m000644 000765 000024 00000005046 11223237412 023605 0ustar00scottcstaff000000 000000 // // BCToolSymbolCounter.m // BioCocoa // // Created by Koen van der Drift on 10/27/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCToolSymbolCounter.h" #import "BCSequence.h" #import "BCSymbol.h" #import "BCFoundationDefines.h" #import "BCInternal.h" @implementation BCToolSymbolCounter + (BCToolSymbolCounter *) symbolCounterWithSequence: (BCSequence *) list { BCToolSymbolCounter *symbolCounter = [[BCToolSymbolCounter alloc] initWithSequence: list]; return [symbolCounter autorelease]; } - (NSCountedSet *)countSymbols { return [self countSymbolsForRange: NSMakeRange(0, [[self sequence] length])]; } - (NSCountedSet *)countSymbolsForRange: (NSRange)aRange { DECLARE_INDEX(loopCounter); BCSymbol *aSymbol; NSCountedSet *aCountedSet = [[NSCountedSet alloc] init]; NSArray *symbolArray = [[self sequence] symbolArray]; for ( loopCounter = aRange.location; loopCounter < aRange.location + aRange.length; loopCounter++ ) { aSymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(symbolArray, loopCounter); [aCountedSet addObject: aSymbol]; } return [aCountedSet autorelease]; } @end biococoa-2.2.2/BCFoundation/BCTools/BCToolTranslator.h000644 000765 000024 00000004101 11223237412 023113 0ustar00scottcstaff000000 000000 // // BCToolTranslatorDNA.h // BioCocoa // // Created by John Timmer on 8/29/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import #import "BCSequenceTool.h" #import "BCFoundationDefines.h" @class BCSequence; @class BCSequenceCodon; @interface BCToolTranslator : BCSequenceTool { int readingFrame; BCGeneticCodeName codeName; } + (BCToolTranslator *) translatorToolWithSequence: (BCSequence *)list; - (int) readingFrame; - (void) setReadingFrame: (int)theFrame; - (BCGeneticCodeName) codeName; - (void)setCodeName: (BCGeneticCodeName)aName; - (BCSequenceCodon *) codonTranslation; - (NSDictionary *) allCodonTranslations; @end biococoa-2.2.2/BCFoundation/BCTools/BCToolTranslator.m000644 000765 000024 00000012325 11223237412 023127 0ustar00scottcstaff000000 000000 // // BCToolTranslator.m // BioCocoa // // Created by John Timmer on 8/29/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCToolTranslator.h" #import "BCNucleotideDNA.h" #import "BCAminoAcid.h" #import "BCSequence.h" #import "BCSequenceCodon.h" #import "BCCodonDNA.h" #import "BCGeneticCode.h" @implementation BCToolTranslator - (BCToolTranslator *) initWithSequence: (BCSequence *)list { self = [super initWithSequence: list]; // set some defaults if ( self != nil ) { readingFrame = 1; codeName = BCUniversalCode; } return self; } - (int) readingFrame { return readingFrame; } - (void) setReadingFrame: (int)theFrame { // this has got to be between -3 and 3, skipping 0. // we default to 1 if ( theFrame > 3 || theFrame == 0 ) readingFrame = 1; else if ( theFrame < -3 ) readingFrame = -1; else readingFrame = theFrame; } - (BCGeneticCodeName) codeName { return codeName; } - (void)setCodeName: (BCGeneticCodeName)aName { codeName = aName; } + (BCToolTranslator *) translatorToolWithSequence: (BCSequence *)list { BCToolTranslator *translatorTool = [[BCToolTranslator alloc] initWithSequence: list]; return [translatorTool autorelease]; } - (BCSequenceCodon *) codonTranslation { // check for the right kind of sequence if ( [sequence sequenceType] != BCSequenceTypeDNA && [sequence sequenceType] != BCSequenceTypeRNA ) return nil; // next, grab the genetic code NSArray *theCode = [BCGeneticCode geneticCode: codeName forSequenceType: [sequence sequenceType]]; if ( theCode == nil || [theCode count] == 0 ) return nil; // adjust the sequence to reflect the desired frame BCSequence *tempSequence; if ( readingFrame < 0 ) tempSequence = [sequence reverse]; else tempSequence = sequence; NSArray *theSequenceArray; if ( abs( readingFrame ) == 1 ) theSequenceArray = [tempSequence symbolArray]; else if ( abs( readingFrame ) == 2 ) theSequenceArray = [tempSequence subSymbolArrayInRange: NSMakeRange( 1, [sequence length] - 1) ]; else theSequenceArray = [tempSequence subSymbolArrayInRange: NSMakeRange( 2, [sequence length] - 2) ]; int codonCount = [theCode count]; int loopCounter, innerCounter; NSMutableArray *returnArray = [NSMutableArray array]; NSArray *tempCodon; BCCodonDNA *aCodon; BOOL oneMatch; for ( loopCounter = 0 ; loopCounter + 2 < [sequence length] ; loopCounter = loopCounter + 3 ) { tempCodon = [theSequenceArray subarrayWithRange: NSMakeRange( loopCounter, 3 ) ]; oneMatch = NO; for ( innerCounter = 0 ; innerCounter < codonCount ; innerCounter++ ) { aCodon = [theCode objectAtIndex: innerCounter]; if ( [aCodon matchesTriplet: tempCodon] ) { [returnArray addObject: aCodon]; oneMatch = YES; break; } } if ( !oneMatch ) [returnArray addObject: [BCCodonDNA unmatched]]; } NSString *frameRep; if ( readingFrame > 0 ) frameRep = [NSString stringWithFormat: @"+%i", readingFrame]; else frameRep = [NSString stringWithFormat: @"-%i", readingFrame]; return [[[BCSequenceCodon alloc] initWithCodonArray: returnArray geneticCode: codeName frame: frameRep] autorelease]; } - (NSDictionary *) allCodonTranslations { // we hang onto the frame that's set because we're going to change it repeatedly int holdingInt = readingFrame; int loopCounter = -4; NSMutableDictionary *theReturn = [NSMutableDictionary dictionary]; BCSequenceCodon *codonSequence; while ( loopCounter < 3) { loopCounter++; if ( loopCounter == 0 ) loopCounter++; readingFrame = loopCounter; codonSequence = [self codonTranslation]; [theReturn setObject: codonSequence forKey: [codonSequence readingFrame]]; } readingFrame = holdingInt; return theReturn; } @end biococoa-2.2.2/BCFoundation/BCTools/BCToolTranslatorDNA.h000644 000765 000024 00000004166 11223237412 023451 0ustar00scottcstaff000000 000000 // // BCToolTranslatorDNA.h // BioCocoa // // Created by John Timmer on 8/29/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import #import "BCSequenceTool.h" #import "BCFoundationDefines.h" @class BCSequence; @interface BCToolTranslatorDNA : BCSequenceTool { BCGeneticCodeName codeName; } + (BCToolTranslatorDNA *) dnaTranslatorToolWithSequence: (BCSequence *)list; + (id) translateSequence: (BCSequence*) entry usingGeneticCode: (BCGeneticCodeName) codeName; + (NSArray *) translateDNASequence: (BCSequence *) entry usingGeneticCode: (BCGeneticCodeName) codeName; - (NSArray *)translateDNASequence; - (BCGeneticCodeName) codeName; - (void)setCodeName: (BCGeneticCodeName)aName; @end biococoa-2.2.2/BCFoundation/BCTools/BCToolTranslatorDNA.m000644 000765 000024 00000007156 11223237412 023460 0ustar00scottcstaff000000 000000 // // BCToolTranslatorDNA.m // BioCocoa // // Created by John Timmer on 8/29/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCToolTranslatorDNA.h" #import "BCNucleotideDNA.h" #import "BCAminoAcid.h" #import "BCSequenceCodon.h" #import "BCCodonDNA.h" #import "BCGeneticCode.h" @implementation BCToolTranslatorDNA + (BCToolTranslatorDNA *) dnaTranslatorToolWithSequence: (BCSequence *) list { BCToolTranslatorDNA *translatorTool = [[BCToolTranslatorDNA alloc] initWithSequence: list]; return [translatorTool autorelease]; } /* + (BCSequenceCodon *) translateSequence: (BCSequence*) entry usingGeneticCode: (BCGeneticCodeName) codeName { return nil; } */ - (NSArray *)translateDNASequence { return [BCToolTranslatorDNA translateDNASequence: [self sequence] usingGeneticCode: [self codeName]]; } - (BCGeneticCodeName) codeName { return codeName; } - (void)setCodeName: (BCGeneticCodeName)aName { codeName = aName; } + (id) translateSequence: (BCSequence*) entry usingGeneticCode: (BCGeneticCodeName) codeName { return nil; } + (NSArray *) translateDNASequence: (BCSequence *) entry usingGeneticCode: (BCGeneticCodeName) codeName { NSArray *theCode = [BCGeneticCode universalGeneticCodeDNA]; if ( theCode == nil ) return nil; int codonCount = [theCode count]; int loopCounter, innerCounter; NSArray *theSequenceArray = [entry symbolArray]; NSMutableArray *returnArray = [NSMutableArray array]; NSArray *tempCodon; BCCodonDNA *aCodon; BOOL oneMatch; for ( loopCounter = 0 ; loopCounter + 2 < [entry length] ; loopCounter = loopCounter + 3 ) { tempCodon = [theSequenceArray subarrayWithRange: NSMakeRange( loopCounter, 3 ) ]; oneMatch = NO; for ( innerCounter = 0 ; innerCounter < codonCount ; innerCounter++ ) { aCodon = [theCode objectAtIndex: innerCounter]; if ( [aCodon matchesTriplet: tempCodon] ) { [returnArray addObject: aCodon]; oneMatch = YES; break; } } if ( !oneMatch ) [returnArray addObject: [BCCodonDNA unmatched]]; } return [[returnArray copy] autorelease]; } @end biococoa-2.2.2/BCFoundation/BCTools/GNUmakefile000644 000765 000024 00000004410 11226023231 021616 0ustar00scottcstaff000000 000000 # # GNUmakefile # # Written by: Scott Christley # Copyright (c) 2003-2009 The BioCocoa Project. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # include $(GNUSTEP_MAKEFILES)/common.make # The library to be compiled SUBPROJECT_NAME = BCTools # The Objective-C source files to be compiled BCTools_OBJC_FILES = \ BCSequenceTool.m \ BCToolDigest.m \ BCToolHydropathyCalculator.m \ BCToolMassCalculator.m \ BCToolComplement.m \ BCToolSequenceFinder.m \ BCToolSymbolCounter.m \ BCToolTranslator.m \ BCToolTranslatorDNA.m # The header files BCTools_HEADER_FILES = \ BCSequenceTool.h \ BCToolDigest.h \ BCToolHydropathyCalculator.h \ BCToolMassCalculator.h \ BCToolComplement.h \ BCToolSequenceFinder.h \ BCToolSymbolCounter.h \ BCToolTranslator.h \ BCToolTranslatorDNA.h BIOCOCOA_BASE_DIR = .. -include $(BIOCOCOA_BASE_DIR)/GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble biococoa-2.2.2/BCFoundation/BCSymbol/BCAminoAcid.h000644 000765 000024 00000014666 11223237412 022136 0ustar00scottcstaff000000 000000 // // BCAminoAcid.h // BioCocoa // // Created by Koen van der Drift on Sat May 10 2003. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Provides in-memory representations of amino acids. */ #import #import "BCSymbol.h" /*! @class BCAminoAcid @abstract All amino acids are handled through this single class @discussion This class provides in-memory representations of amino acids. */ @interface BCAminoAcid : BCSymbol { NSString *threeLetterCode; float kyteDoolittleValue; float hoppWoodsValue; float pKaValue; } /*! @method initAminoAcids @abstract Used internaly to generate the full set of amino acid objects. */ + (void) initAminoAcids; /*! @method objectForSavedRepresentation: (NSString *)aSymbol @abstract Returns a BCAminoAcid object representing the amino acid submitted @discussion all BC classes should implement a "savableRepresentation" and an * "objectForSavedRepresentation" method to allow archiving/uncarchiving in * .plist formatted files. */ + (id) objectForSavedRepresentation: (NSString *)aSymbol; /*! @method aaPropertiesDict @abstract Returns a singleton NSDictionary holding the information for an amino acid */ + (NSMutableDictionary *) aaPropertiesDict; /*! @method symbolForChar: (unsigned char)symbol @abstract Returns a BCAminoAcid item representing the amino acid submitted */ + (id) symbolForChar: (unsigned char)symbol; /*! @method alanine @abstract Obtains a reference to the single alanine representation */ + (BCAminoAcid *) alanine; /*! @method arginine @abstract Obtains a reference to the single arginine representation */ + (BCAminoAcid *) arginine; /*! @method asparagine @abstract Obtains a reference to the single asparagine representation */ + (BCAminoAcid *) asparagine; /*! @method asparticacid @abstract Obtains a reference to the single asparticacid representation */ + (BCAminoAcid *) asparticacid; /*! @method cysteine @abstract Obtains a reference to the single cysteine representation */ + (BCAminoAcid *) cysteine; /*! @method glutamicacid @abstract Obtains a reference to the single glutamicacid representation */ + (BCAminoAcid *) glutamicacid; /*! @method glutamine @abstract Obtains a reference to the single glutamine representation */ + (BCAminoAcid *) glutamine; /*! @method glycine @abstract Obtains a reference to the single glycine representation */ + (BCAminoAcid *) glycine; /*! @method histidine @abstract Obtains a reference to the single histidine representation */ + (BCAminoAcid *) histidine; /*! @method isoleucine @abstract Obtains a reference to the single isoleucine representation */ + (BCAminoAcid *) isoleucine; /*! @method leucine @abstract Obtains a reference to the single leucine representation */ + (BCAminoAcid *) leucine; /*! @method lysine @abstract Obtains a reference to the single lysine representation */ + (BCAminoAcid *) lysine; /*! @method methionine @abstract Obtains a reference to the single methionine representation */ + (BCAminoAcid *) methionine; /*! @method phenylalanine @abstract Obtains a reference to the single phenylalanine representation */ + (BCAminoAcid *) phenylalanine; /*! @method proline @abstract Obtains a reference to the single proline representation */ + (BCAminoAcid *) proline; /*! @method serine @abstract Obtains a reference to the single serine representation */ + (BCAminoAcid *) serine; /*! @method threonine @abstract Obtains a reference to the single threonine representation */ + (BCAminoAcid *) threonine; /*! @method tryptophan @abstract Obtains a reference to the single tryptophan representation */ + (BCAminoAcid *) tryptophan; /*! @method tyrosine @abstract Obtains a reference to the single tyrosine representation */ + (BCAminoAcid *) tyrosine; /*! @method valine @abstract Obtains a reference to the single valine representation */ + (BCAminoAcid *) valine; /*! @method asx @abstract Obtains a reference to the single asx amino acid representation */ + (BCAminoAcid *) asx; /*! @method glx @abstract Obtains a reference to the single glx amino acid representation */ + (BCAminoAcid *) glx; /*! @method gap @abstract Obtains a reference to the single gap amino acid representation */ + (BCAminoAcid *) gap; /*! @method undefined @abstract Obtains a reference to the single undefined amino acid representation */ + (BCAminoAcid *) undefined; /*! @method threeLetterCode @abstract Returns an NSString containg the three letter code for the amino acid */ - (NSString *)threeLetterCode; - (float)kyteDoolittleValue; - (void)setKyteDoolittleValue:(float)value; - (float)hoppWoodsValue; - (void)setHoppWoodsValue:(float)value; - (float)pKaValue; - (void)setpKaValue:(float)value; @end biococoa-2.2.2/BCFoundation/BCSymbol/BCAminoAcid.m000644 000765 000024 00000040562 11223237412 022135 0ustar00scottcstaff000000 000000 // // BCAminoAcid.m // BioCocoa // // Created by Koen van der Drift on Sat May 10 2003. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCAminoAcid.h" #import "BCStringDefinitions.h" static BCAminoAcid *alanineRepresentation = nil; static BCAminoAcid *arginineRepresentation = nil; static BCAminoAcid *asparagineRepresentation = nil; static BCAminoAcid *asparticacidRepresentation = nil; static BCAminoAcid *cysteineRepresentation = nil; static BCAminoAcid *glutamicacidRepresentation = nil; static BCAminoAcid *glutamineRepresentation = nil; static BCAminoAcid *glycineRepresentation = nil; static BCAminoAcid *histidineRepresentation = nil; static BCAminoAcid *isoleucineRepresentation = nil; static BCAminoAcid *leucineRepresentation = nil; static BCAminoAcid *lysineRepresentation = nil; static BCAminoAcid *methionineRepresentation = nil; static BCAminoAcid *phenylalanineRepresentation = nil; static BCAminoAcid *prolineRepresentation = nil; static BCAminoAcid *serineRepresentation = nil; static BCAminoAcid *threonineRepresentation = nil; static BCAminoAcid *tryptophanRepresentation = nil; static BCAminoAcid *tyrosineRepresentation = nil; static BCAminoAcid *valineRepresentation = nil; static BCAminoAcid *glxRepresentation = nil; static BCAminoAcid *asxRepresentation = nil; static BCAminoAcid *gapRepresentation = nil; static BCAminoAcid *undefinedRepresentation = nil; static NSMutableDictionary *aminoAcidPropertiesDict = nil; @implementation BCAminoAcid - (id)initWithSymbolChar:(unsigned char)aChar { if ([super initWithSymbolChar:aChar]) { symbolInfo = [[[BCAminoAcid aaPropertiesDict] objectForKey:[self symbolString]] copy]; if ( nil == symbolInfo ) { return nil; } name = [[symbolInfo objectForKey: BCSymbolNameProperty] copy]; threeLetterCode = [[symbolInfo objectForKey: BCSymbolThreeLetterCodeProperty] copy]; [self setKyteDoolittleValue: [[symbolInfo objectForKey: BCSymbolKyteDoolittleProperty] floatValue]]; [self setHoppWoodsValue: [[symbolInfo objectForKey: BCSymbolHoppWoodsProperty] floatValue]]; [self setpKaValue: [[symbolInfo objectForKey: BCSymbolpKaProperty] floatValue]]; [self setMonoisotopicMass: [[symbolInfo objectForKey: BCSymbolMonoisotopicMassProperty] floatValue]]; [self setAverageMass: [[symbolInfo objectForKey: BCSymbolAverageMassProperty] floatValue]]; } return self; } - (void)dealloc { [symbolInfo release]; [name release]; [threeLetterCode release]; [super dealloc]; } + (NSMutableDictionary *) aaPropertiesDict { if ( aminoAcidPropertiesDict == nil ) { NSString *filePath = [[NSBundle bundleForClass: [BCAminoAcid class]] pathForResource: @"aminoacids" ofType: @"plist"]; aminoAcidPropertiesDict = [NSMutableDictionary dictionaryWithContentsOfFile: filePath]; } return aminoAcidPropertiesDict; } + (id) symbolForChar: (unsigned char)aSymbol { switch ( aSymbol ) { case 'A' : case 'a' : { return [BCAminoAcid alanine]; break; } case 'R' : case 'r' : { return [BCAminoAcid arginine]; break; } case 'N' : case 'n' : { return [BCAminoAcid asparagine]; break; } case 'D' : case 'd' : { return [BCAminoAcid asparticacid]; break; } case 'C' : case 'c' : { return [BCAminoAcid cysteine]; break; } case 'E' : case 'e' : { return [BCAminoAcid glutamicacid]; break; } case 'Q' : case 'q' : { return [BCAminoAcid glutamine]; break; } case 'G' : case 'g' : { return [BCAminoAcid glycine]; break; } case 'H' : case 'h' : { return [BCAminoAcid histidine]; break; } case 'I' : case 'i' : { return [BCAminoAcid isoleucine]; break; } case 'L' : case 'l' : { return [BCAminoAcid leucine]; break; } case 'K' : case 'k' : { return [BCAminoAcid lysine]; break; } case 'M' : case 'm' : { return [BCAminoAcid methionine]; break; } case 'F' : case 'f' : { return [BCAminoAcid phenylalanine]; break; } case 'P' : case 'p' : { return [BCAminoAcid proline]; break; } case 'S' : case 's' : { return [BCAminoAcid serine]; break; } case 'T' : case 't' : { return [BCAminoAcid threonine]; break; } case 'W' : case 'w' : { return [BCAminoAcid tryptophan]; break; } case 'Y' : case 'y' : { return [BCAminoAcid tyrosine]; break; } case 'V' : case 'v' : { return [BCAminoAcid valine]; break; } case 'B' : case 'b' : { return [BCAminoAcid asx]; break; } case 'Z' : case 'z' : { return [BCAminoAcid glx]; break; } case '-' : { return [BCAminoAcid gap]; break; } case '*' : { return nil; // stop amino acid break; } default : return [BCAminoAcid undefined]; } } + (id) objectForSavedRepresentation: (NSString *)aSymbol { return [BCAminoAcid symbolForChar: [aSymbol characterAtIndex: 0]]; } + (void) initAminoAcids { NSDictionary *aaDefinitions = [BCAminoAcid aaPropertiesDict]; NSDictionary *tempDict = [aaDefinitions objectForKey: @"A"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { alanineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'A']; } tempDict = [aaDefinitions objectForKey: @"R"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { arginineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'R']; } tempDict = [aaDefinitions objectForKey: @"N"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { asparagineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'N']; } tempDict = [aaDefinitions objectForKey: @"D"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { asparticacidRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'D']; } tempDict = [aaDefinitions objectForKey: @"C"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { cysteineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'C']; } tempDict = [aaDefinitions objectForKey: @"E"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { glutamicacidRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'E']; } tempDict = [aaDefinitions objectForKey: @"Q"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { glutamineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'Q']; } tempDict = [aaDefinitions objectForKey: @"G"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { glycineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'G']; } tempDict = [aaDefinitions objectForKey: @"H"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { histidineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'H']; } tempDict = [aaDefinitions objectForKey: @"I"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { isoleucineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'I']; } tempDict = [aaDefinitions objectForKey: @"L"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { leucineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'L']; } tempDict = [aaDefinitions objectForKey: @"K"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { lysineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'K']; } tempDict = [aaDefinitions objectForKey: @"M"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { methionineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'M']; } tempDict = [aaDefinitions objectForKey: @"F"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { phenylalanineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'F']; } tempDict = [aaDefinitions objectForKey: @"P"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { prolineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'P']; } tempDict = [aaDefinitions objectForKey: @"S"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { serineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'S']; } tempDict = [aaDefinitions objectForKey: @"T"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { threonineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'T']; } tempDict = [aaDefinitions objectForKey: @"W"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { tryptophanRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'W']; } tempDict = [aaDefinitions objectForKey: @"Y"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { tyrosineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'Y']; } tempDict = [aaDefinitions objectForKey: @"V"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { valineRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'V']; } tempDict = [aaDefinitions objectForKey: @"B"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { asxRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'B']; } tempDict = [aaDefinitions objectForKey: @"Z"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { glxRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: 'Z']; } tempDict = [aaDefinitions objectForKey: @"-"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { gapRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: '-']; } tempDict = [aaDefinitions objectForKey: @"?"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { undefinedRepresentation = [[BCAminoAcid alloc] initWithSymbolChar: '?']; } } + (BCAminoAcid *) alanine { if ( alanineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return alanineRepresentation; } + (BCAminoAcid *) arginine { if ( arginineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return arginineRepresentation; } + (BCAminoAcid *) asparagine { if ( asparagineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return asparagineRepresentation; } + (BCAminoAcid *) asparticacid { if ( asparticacidRepresentation == nil ) [BCAminoAcid initAminoAcids]; return asparticacidRepresentation; } + (BCAminoAcid *) cysteine { if ( cysteineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return cysteineRepresentation; } + (BCAminoAcid *) glutamicacid { if ( glutamicacidRepresentation == nil ) [BCAminoAcid initAminoAcids]; return glutamicacidRepresentation; } + (BCAminoAcid *) glutamine { if ( glutamineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return glutamineRepresentation; } + (BCAminoAcid *) glycine { if ( glycineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return glycineRepresentation; } + (BCAminoAcid *) histidine { if ( histidineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return histidineRepresentation; } + (BCAminoAcid *) isoleucine { if ( isoleucineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return isoleucineRepresentation; } + (BCAminoAcid *) leucine { if ( leucineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return leucineRepresentation; } + (BCAminoAcid *) lysine { if ( lysineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return lysineRepresentation; } + (BCAminoAcid *) methionine { if ( methionineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return methionineRepresentation; } + (BCAminoAcid *) phenylalanine { if ( phenylalanineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return phenylalanineRepresentation; } + (BCAminoAcid *) proline { if ( prolineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return prolineRepresentation; } + (BCAminoAcid *) serine { if ( serineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return serineRepresentation; } + (BCAminoAcid *) threonine { if ( threonineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return threonineRepresentation; } + (BCAminoAcid *) tryptophan { if ( tryptophanRepresentation == nil ) [BCAminoAcid initAminoAcids]; return tryptophanRepresentation; } + (BCAminoAcid *) tyrosine { if ( tyrosineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return tyrosineRepresentation; } + (BCAminoAcid *) valine { if ( valineRepresentation == nil ) [BCAminoAcid initAminoAcids]; return valineRepresentation; } + (BCAminoAcid *) asx { if ( asxRepresentation == nil ) [BCAminoAcid initAminoAcids]; return asxRepresentation; } + (BCAminoAcid *) glx { if ( glxRepresentation == nil ) [BCAminoAcid initAminoAcids]; return glxRepresentation; } + (BCAminoAcid *) gap { if ( gapRepresentation == nil ) [BCAminoAcid initAminoAcids]; return gapRepresentation; } + (BCAminoAcid *) undefined { if ( undefinedRepresentation == nil ) [BCAminoAcid initAminoAcids]; return undefinedRepresentation; } - (NSString *)threeLetterCode { return threeLetterCode; } - (float)kyteDoolittleValue { return kyteDoolittleValue; } - (void)setKyteDoolittleValue:(float)value { kyteDoolittleValue = value; } - (float)hoppWoodsValue { return hoppWoodsValue; } - (void)setHoppWoodsValue:(float)value { hoppWoodsValue = value; } - (float)pKaValue { return pKaValue; } - (void)setpKaValue:(float)value { pKaValue = value; } @end biococoa-2.2.2/BCFoundation/BCSymbol/BCNucleotide.h000644 000765 000024 00000006253 11223237412 022376 0ustar00scottcstaff000000 000000 // // BCNucleotide.h // BioCocoa // // Created by John Timmer on 2/25/05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Provides in-memory representations of nucleotides. */ #import #import "BCSymbol.h" /*! @class BCNucleotide @abstract Nucleotide specific symbols. @discussion This class provides in-memory representations of nucleotides. */ @interface BCNucleotide : BCSymbol { BCSymbol *complement; NSSet *complements; } /////////////////////////////////////////////////////////// // COMPLEMENTATION METHODS /////////////////////////////////////////////////////////// /*! @method complement @abstract Returns a reference to the symbol the complements the receiver @discussion When called on adenosine, this method will return a reference to thyidine. * For ambiguous symbol, it returns the single most complete complement - when called on purine, * it will return only pyrimidine. For amino acids, this will return nil. */ - (BCNucleotide *)complement; /*! @method complements @abstract Returns references all symbols that may complement the receiver in an array @discussion When called on adenosine, this method will return an array containing references * to thyidine, weak, any, etc. For amino acids, this will return nil. */ - (NSSet *)complements; /*! @method complementsSymbol: (BCSymbol *)entry; @abstract Evaluates whether the receiver complements the entry @discussion When called on adenosine, this method will return YES if the entry is thymidine, * weak, any base, etc. For amino acids, this will return nil. */ - (BOOL) complementsSymbol: (BCNucleotide *)entry; - (BOOL) isComplementOfSymbol: (BCNucleotide *)entry; @end biococoa-2.2.2/BCFoundation/BCSymbol/BCNucleotide.m000644 000765 000024 00000010272 11223237412 022377 0ustar00scottcstaff000000 000000 // // BCNucleotide.m // BioCocoa // // Created by John Timmer on 2/25/05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCNucleotide.h" #import "BCStringDefinitions.h" #import "BCInternal.h" @implementation BCNucleotide - (id)initWithSymbolChar:(unsigned char)aChar { if ( (self = [super initWithSymbolChar: aChar]) ) { complement = nil; complements = nil; } return self; } - (void)dealloc { [complement release]; [complements release]; [super dealloc]; } - (void) initializeComplementRelationships { // THIS METHOD IS CALLED AFTER OBJECT INITIALIZATION BECAUSE IT // REQUIRES THE EXISTENCE OF ALL THE OTHER SYMBOLS IN ORDER TO WORK // IT SHOULD BE CALLED THE FIRST TIME ONE OF THESE INSTANCE OBJECTS IS NEEDED NSString *symbolReference; NSArray *infoArray; NSEnumerator *objectEnumerator; NSMutableArray *tempArray; BCSymbol *tempSymbol; symbolReference = [[self symbolInfo] objectForKey: BCSymbolComplementProperty]; if ( symbolReference != nil || [symbolReference length] > 0 ) { complement = [(BCNucleotide *)[self class] performSelector: NSSelectorFromString( symbolReference )]; } infoArray = [[self symbolInfo] objectForKey: BCSymbolAllComplementsProperty]; if ( infoArray != nil || [infoArray count] > 0 ) { objectEnumerator = [infoArray objectEnumerator]; tempArray = [NSMutableArray array]; while ( (symbolReference = [objectEnumerator nextObject]) ) { if ( symbolReference != nil || [symbolReference length] > 0 ) { tempSymbol = [(BCNucleotide *)[self class] performSelector: NSSelectorFromString( symbolReference )]; if ( tempSymbol != nil ) [tempArray addObject: tempSymbol]; } } complements = [[NSSet setWithArray: tempArray] retain]; } } /////////////////////////////////////////////////////////// // COMPLEMENTATION METHODS /////////////////////////////////////////////////////////// - (BCNucleotide *)complement { if ( complement == nil ) [self initializeComplementRelationships]; return (BCNucleotide *)complement; } - (NSSet *)complements { if ( complements == nil ) [self initializeComplementRelationships]; return complements; } - (BOOL) complementsSymbol: (BCNucleotide *)entry { if ( complements == nil ) [self initializeComplementRelationships]; // the following is the equivalent of return [complements containsObject: entry]; return SET_CONTAINS_VALUE(complements, entry); } - (BOOL) isComplementOfSymbol: (BCNucleotide *)entry { return [entry complementsSymbol: self]; } @end biococoa-2.2.2/BCFoundation/BCSymbol/BCNucleotideDNA.h000644 000765 000024 00000016334 11223237412 022722 0ustar00scottcstaff000000 000000 // // BCNucleotideDNA.h // BioCocoa // // Created by John Timmer on 8/11/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Provides in-memory representations of DNA bases. */ #import #import "BCNucleotide.h" @class BCNucleotideRNA; /*! @class BCNucleotideDNA @abstract All DNA bases are handled through this single class @discussion This class provides in-memory representations of DNA bases. * Through class methods and static variables, single application wide representations * of each individual base and the ambiguous base representations are provided to all * BioCocoa applications. Access to an individual base is provided by methods such as: * [BCNucleotideDNA adenine]; * [BCNucleotideDNA purine]; * Repesentations of a non-base and gap characters (for alignments) are also available. * Typically, bases are not handled directly, but rather through their container objects, * BCSequence subclasses. * * Why not use strings? * Unicode characters are 16bit, while pointers on MacOS-X are (currently) 32 bit. In * the overall picture, memory differences are not significant. In return, each base provides * detailed information about complements, ambiguity, etc. which would otherwise need to be coded * by hand. * * Initialization of base data * Details of base information and relationships are read from the "nucleotides.plist" file * within the Framework bundle. Loss or alteration of this file will cause all DNA-based programs * to fail. References to other bases (ie - the complement) are retained as string-formatted selectors * until they are needed, at which point they are used to generate pointers to the other bases. * Custom bases can be generated using this file as an example - they remain stored in an NSDictionary. * * Individual bases are obtained using their named class method, or by sending an appropriate symbol to the * "symbolForChar:" class method. */ @interface BCNucleotideDNA : BCNucleotide { } #if 0 #pragma mark == CLASS METHODS == #endif /*! @method initBases @abstract Used internaly to generate the full set of base objects. */ + (void) initBases; /*! @method symbolForChar: @abstract Returns a BCNucleotideDNA item representing the base submitted */ + (id) symbolForChar: (unsigned char)symbol; /*! @method objectForSavedRepresentation: @abstract Returns a BCNucleotideDNA object representing the base submitted @discussion all BC classes should implement a "savableRepresentation" and an * "objectForSavedRepresentation" method to allow archiving/uncarchiving in * .plist formatted files. */ + (id) objectForSavedRepresentation: (NSString *)aSymbol; /*! @method adenosine @abstract Obtains a reference to the single adenosine representation */ + (BCNucleotideDNA *) adenosine; /*! @method thymidine @abstract Obtains a reference to the single thymidine representation */ + (BCNucleotideDNA *) thymidine; /*! @method cytidine @abstract Obtains a reference to the single cytidine representation */ + (BCNucleotideDNA *) cytidine; /*! @method guanidine @abstract Obtains a reference to the single guanidine representation */ + (BCNucleotideDNA *) guanidine; /*! @method anyBase @abstract Obtains a reference to the single N representation */ + (BCNucleotideDNA *) anyBase; /*! @method purine @abstract Obtains a reference to the single purine representation */ + (BCNucleotideDNA *) purine; /*! @method pyrimidine @abstract Obtains a reference to the single pyrimidine representation */ + (BCNucleotideDNA *) pyrimidine; /*! @method strong @abstract Obtains a reference to the single strong-bond representation */ + (BCNucleotideDNA *) strong; /*! @method weak @abstract Obtains a reference to the single weak-bond representation */ + (BCNucleotideDNA *) weak; /*! @method M @abstract Obtains a reference to the single M (A, C) representation */ + (BCNucleotideDNA *) amino; /*! @method K @abstract Obtains a reference to the single K (A, C) representation */ + (BCNucleotideDNA *) keto; /*! @method H @abstract Obtains a reference to the single H (A, C, T) representation */ + (BCNucleotideDNA *) H; /*! @method V @abstract Obtains a reference to the single V (A, C, G) representation */ + (BCNucleotideDNA *) V; /*! @method D @abstract Obtains a reference to the single D (A, G, T) representation */ + (BCNucleotideDNA *) D; /*! @method B @abstract Obtains a reference to the single D (C, G, T) representation */ + (BCNucleotideDNA *) B; /*! @method gap @abstract Obtains a reference to the single representation of a gap, for alignments */ + (BCNucleotideDNA *) gap; /*! @method undefined @abstract Obtains a reference to the single representation of any non-base character */ + (BCNucleotideDNA *) undefined; /*! @method customBase: @abstract Obtains a reference to a user-defined base */ + (BCNucleotideDNA *) customBase: (NSString *)baseName; #if 0 #pragma mark == OBJECT METHODS == #endif #if 0 #pragma mark == INITIALIZATION METHODS == #endif /*! @method initWithSymbolChar: @abstract designated initialization method @discussion Given a symbol, this method generates the appropriate Nucleotide representation using * information in the bundle's "nucleotides.plist" file. */ - (id)initWithSymbolChar:(unsigned char)aChar; #if 0 #pragma mark == BASE INFORMATION METHODS == #endif /*! @method isBase @abstract Returns NO if the receiver is a gap or undefined */ - (BOOL) isBase; #if 0 #pragma mark == BASE RELATIONSHIP METHODS == #endif - (BCNucleotideRNA *) RNABaseEquivalent; @end biococoa-2.2.2/BCFoundation/BCSymbol/BCNucleotideDNA.m000644 000765 000024 00000037047 11223237412 022733 0ustar00scottcstaff000000 000000 // // BCNucleotideDNA.m // BioCocoa // // Created by John Timmer on 8/11/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCNucleotideDNA.h" #import "BCNucleotideRNA.h" static BCNucleotideDNA *adenosineRepresentation = nil; static BCNucleotideDNA *thymidineRepresentation = nil; static BCNucleotideDNA *cytidineRepresentation = nil; static BCNucleotideDNA *guanidineRepresentation = nil; static BCNucleotideDNA *anyBaseRepresentation = nil; static BCNucleotideDNA *purineRepresentation = nil; static BCNucleotideDNA *pyrimidineRepresentation = nil; static BCNucleotideDNA *strongRepresentation = nil; static BCNucleotideDNA *weakRepresentation = nil; static BCNucleotideDNA *aminoRepresentation = nil; static BCNucleotideDNA *ketoRepresentation = nil; static BCNucleotideDNA *HRepresentation = nil; static BCNucleotideDNA *VRepresentation = nil; static BCNucleotideDNA *DRepresentation = nil; static BCNucleotideDNA *BRepresentation = nil; static BCNucleotideDNA *gapRepresentation = nil; static BCNucleotideDNA *undefinedRepresentation = nil; static NSMutableDictionary *customBases = nil; @implementation BCNucleotideDNA #if 0 #pragma mark CLASS METHODS #endif //////////////////////////////////////////////////////////////////////////// // THIS METHOD CREATES THE SINGLETON REFERENCES TO ALL THE STANDARD BASES //////////////////////////////////////////////////////////////////////////// + (void) initBases { // FIND OUR BUNDLE AND LOAD UP THE BASE DEFINITIONS NSBundle *biococoaBundle = [NSBundle bundleForClass: [BCNucleotideDNA class]]; NSString *filePath = [biococoaBundle pathForResource: @"nucleotides" ofType: @"plist"]; if ( filePath == nil ) return; NSMutableDictionary *baseDefinitions = [NSMutableDictionary dictionaryWithContentsOfFile: filePath]; if ( baseDefinitions == nil ) return; customBases = [baseDefinitions retain]; // GO THROUGH AND CREATE EACH SINGLETON BASE DEFINITION, USING THE DICTIONARY NSDictionary *tempDict = [baseDefinitions objectForKey: @"A"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { adenosineRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'A']; [baseDefinitions removeObjectForKey: @"A"]; } tempDict = [baseDefinitions objectForKey: @"T"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { thymidineRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'T']; [baseDefinitions removeObjectForKey: @"T"]; } tempDict = [baseDefinitions objectForKey: @"C"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { cytidineRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'C']; [baseDefinitions removeObjectForKey: @"C"]; } tempDict = [baseDefinitions objectForKey: @"G"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { guanidineRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'G']; [baseDefinitions removeObjectForKey: @"G"]; } tempDict = [baseDefinitions objectForKey: @"N"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { anyBaseRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'N']; [baseDefinitions removeObjectForKey: @"N"]; } tempDict = [baseDefinitions objectForKey: @"R"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { purineRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'R']; [baseDefinitions removeObjectForKey: @"R"]; } tempDict = [baseDefinitions objectForKey: @"Y"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { pyrimidineRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'Y']; [baseDefinitions removeObjectForKey: @"Y"]; } tempDict = [baseDefinitions objectForKey: @"S"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { strongRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'S']; [baseDefinitions removeObjectForKey: @"S"]; } tempDict = [baseDefinitions objectForKey: @"W"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { weakRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'W']; [baseDefinitions removeObjectForKey: @"W"]; } tempDict = [baseDefinitions objectForKey: @"M"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { aminoRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'M']; [baseDefinitions removeObjectForKey: @"M"]; } tempDict = [baseDefinitions objectForKey: @"K"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { ketoRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'K']; [baseDefinitions removeObjectForKey: @"K"]; } tempDict = [baseDefinitions objectForKey: @"H"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { HRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'H']; [baseDefinitions removeObjectForKey: @"H"]; } tempDict = [baseDefinitions objectForKey: @"V"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { VRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'V']; [baseDefinitions removeObjectForKey: @"V"]; } tempDict = [baseDefinitions objectForKey: @"D"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { DRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'D']; [baseDefinitions removeObjectForKey: @"D"]; } tempDict = [baseDefinitions objectForKey: @"B"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { BRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: 'B']; [baseDefinitions removeObjectForKey: @"B"]; } tempDict = [baseDefinitions objectForKey: @"-"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { gapRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: '-']; [baseDefinitions removeObjectForKey: @"-"]; } tempDict = [baseDefinitions objectForKey: @"?"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { undefinedRepresentation = [[BCNucleotideDNA alloc] initWithSymbolChar: '?']; [baseDefinitions removeObjectForKey: @"?"]; } // hang on to the dictionary, in case there are custom bases customBases = [baseDefinitions retain]; } + (id) objectForSavedRepresentation: (NSString *)aSymbol { return [BCNucleotideDNA symbolForChar: [aSymbol characterAtIndex: 0]]; } //////////////////////////////////////////////////////////////////////////// // THE FOLLOWING IS A METHOD FOR OBTAINING REFERENCES TO THE // INDIVIDUAL BASE REPRESENTATIONS WHEN GIVEN A SINGLE LETTER CODE // // THIS WILL NOT WORK WITH CUSTOM BASES, SINCE THEIR SYMBOLS ARE NOT KNOWN IN ADVACE //////////////////////////////////////////////////////////////////////////// + (id) symbolForChar: (unsigned char)entry { switch ( entry ) { case 'A' : case 'a' : { return [BCNucleotideDNA adenosine]; break; } case 'T' : case 't' : { return [BCNucleotideDNA thymidine]; break; } case 'C' : case 'c' : { return [BCNucleotideDNA cytidine]; break; } case 'G' : case 'g' : { return [BCNucleotideDNA guanidine]; break; } case 'N' : case 'n' : { return [BCNucleotideDNA anyBase]; break; } case 'R' : case 'r' : { return [BCNucleotideDNA purine]; break; } case 'Y' : case 'y' : { return [BCNucleotideDNA pyrimidine]; break; } case 'W' : case 'w' : { return [BCNucleotideDNA weak]; break; } case 'S' : case 's' : { return [BCNucleotideDNA strong]; break; } case 'M' : case 'm' : { return [BCNucleotideDNA amino]; break; } case 'K' : case 'k' : { return [BCNucleotideDNA keto]; break; } case 'H' : case 'h' : { return [BCNucleotideDNA H]; break; } case 'V' : case 'v' : { return [BCNucleotideDNA V]; break; } case 'D' : case 'd' : { return [BCNucleotideDNA D]; break; } case 'B' : case 'b' : { return [BCNucleotideDNA B]; break; } case '-' : { return [BCNucleotideDNA gap]; break; } default : return [BCNucleotideDNA undefined]; } } //////////////////////////////////////////////////////////////////////////// // THE FOLLOWING ARE METHODS FOR OBTAINING REFERENCES TO THE // INDIVIDUAL BASE REPRESENTATIONS //////////////////////////////////////////////////////////////////////////// + (BCNucleotideDNA *) adenosine { if ( adenosineRepresentation == nil ) [BCNucleotideDNA initBases]; return adenosineRepresentation; } + (BCNucleotideDNA *) thymidine { if ( thymidineRepresentation == nil ) [BCNucleotideDNA initBases]; return thymidineRepresentation; } + (BCNucleotideDNA *) cytidine { if ( cytidineRepresentation == nil ) [BCNucleotideDNA initBases]; return cytidineRepresentation; } + (BCNucleotideDNA *) guanidine { if ( guanidineRepresentation == nil ) [BCNucleotideDNA initBases]; return guanidineRepresentation; } + (BCNucleotideDNA *) anyBase { if ( anyBaseRepresentation == nil ) [BCNucleotideDNA initBases]; return anyBaseRepresentation; } + (BCNucleotideDNA *) purine { if ( purineRepresentation == nil ) [BCNucleotideDNA initBases]; return purineRepresentation; } + (BCNucleotideDNA *) pyrimidine { if ( pyrimidineRepresentation == nil ) [BCNucleotideDNA initBases]; return pyrimidineRepresentation; } + (BCNucleotideDNA *) strong { if ( strongRepresentation == nil ) [BCNucleotideDNA initBases]; return strongRepresentation; } + (BCNucleotideDNA *) weak { if ( weakRepresentation == nil ) [BCNucleotideDNA initBases]; return weakRepresentation; } + (BCNucleotideDNA *) amino { if ( aminoRepresentation == nil ) [BCNucleotideDNA initBases]; return aminoRepresentation; } + (BCNucleotideDNA *) keto { if ( ketoRepresentation == nil ) [BCNucleotideDNA initBases]; return ketoRepresentation; } + (BCNucleotideDNA *) H { if ( HRepresentation == nil ) [BCNucleotideDNA initBases]; return HRepresentation; } + (BCNucleotideDNA *) V { if ( VRepresentation == nil ) [BCNucleotideDNA initBases]; return VRepresentation; } + (BCNucleotideDNA *) D { if ( DRepresentation == nil ) [BCNucleotideDNA initBases]; return DRepresentation; } + (BCNucleotideDNA *) B { if ( BRepresentation == nil ) [BCNucleotideDNA initBases]; return BRepresentation; } + (BCNucleotideDNA *) gap { if ( gapRepresentation == nil ) [BCNucleotideDNA initBases]; return gapRepresentation; } + (BCNucleotideDNA *) undefined { if ( undefinedRepresentation == nil ) [BCNucleotideDNA initBases]; return undefinedRepresentation; } + (BCNucleotideDNA *) customBase: (NSString *)baseName { if ( customBases == nil ) [BCNucleotideDNA initBases]; id aBase = [customBases objectForKey: baseName]; if ( aBase == nil) return nil; if ( [aBase isKindOfClass: [BCNucleotideDNA class]] ) return aBase; if ( [aBase isKindOfClass: [NSDictionary class]] ) { aBase = [[[BCNucleotideDNA alloc] initWithDictionary: aBase] autorelease]; if ( aBase != nil ) { [customBases setObject: aBase forKey: baseName]; return aBase; } } return nil; } //////////////////////////////////////////////////////////////////////////// // OBJECT METHODS //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark OBJECT METHODS #pragma mark #pragma mark INITIALIZATION METHODS #endif - (id) initWithSymbolChar: (unsigned char)aSymbol { self = [super initWithSymbolChar: aSymbol]; if ( self == nil ) return nil; // we hang onto the dictionary in order to establish complement realtionships // once all the bases are generated symbolInfo = [[customBases objectForKey: symbolString] copy]; // get basic information about this base name = [symbolInfo objectForKey: @"Name"]; if (name == nil) return nil; else [name retain]; [self setMonoisotopicMass: [[symbolInfo objectForKey:@"MonoisotopicMass"] floatValue]]; [self setAverageMass: [[symbolInfo objectForKey:@"AverageMass"] floatValue]]; return self; } #if 0 #pragma mark BASE INFORMATION METHODS #endif - (BOOL) isBase { if ( self == [BCNucleotideDNA gap] || self == [BCNucleotideDNA undefined] ) return NO; return YES; } #if 0 #pragma mark BASE RELATIONSHIP METHODS #endif - (BCNucleotideRNA *) RNABaseEquivalent { if ( self != [BCNucleotideDNA thymidine] ) return [BCNucleotideRNA performSelector: NSSelectorFromString( name )]; return [BCNucleotideRNA uridine] ; } @end biococoa-2.2.2/BCFoundation/BCSymbol/BCNucleotideRNA.h000644 000765 000024 00000016327 11223237412 022742 0ustar00scottcstaff000000 000000 // // BCNucleotideRNA.h // BioCocoa // // Created by John Timmer on 8/11/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Provides in-memory representations of RNA bases. */ #import #import "BCNucleotide.h" @class BCNucleotideDNA; /*! @class BCNucleotideRNA @abstract All RNA bases are handled through this single class @discussion This class provides in-memory representations of RNA bases. * Through class methods and static variables, single application wide representations * of each individual base and the ambiguous base representations are provided to all * BioCocoa applications. Access to an individual base is provided by methods such as: * [BCNucleotideRNA adenine]; * [BCNucleotideRNA purine]; * Repesentations of a non-base and gap characters (for alignments) are also available. * Typically, bases are not handled directly, but rather through their container objects, * BCSequence subclasses. * * Why not use strings? * Unicode characters are 16bit, while pointers on MacOS-X are (currently) 32 bit. In * the overall picture, memory differences are not significant. In return, each base provides * detailed information about complements, ambiguity, etc. which would otherwise need to be coded * by hand. * * Initialization of base data * Details of base information and relationships are read from the "base template.plist" file * within the Framework bundle. Loss or alteration of this file will cause all RNA-based programs * to fail. References to other bases (ie - the complement) are retained as string-formatted selectors * until they are needed, at which point they are used to generate pointers to the other bases. * Custom bases can be generated using this file as an example - they remain stored in an NSDictionary. * * Individual bases are obtained using their named class method, or by sending an appropriate symbol to the * "symbolForChar:" class method. */ @interface BCNucleotideRNA : BCNucleotide { } #if 0 #pragma mark == CLASS METHODS == #endif /*! @method initBases @abstract Used internaly to generate the full set of base objects. */ + (void) initBases; /*! @method symbolForChar: @abstract Returns a BCNucleotideRNA item representing the base submitted */ + (id) symbolForChar: (unsigned char)symbol; /*! @method objectForSavedRepresentation: @abstract Returns a BCNucleotideRNA object representing the base submitted @discussion all BC classes should implement a "savableRepresentation" and an * "objectForSavedRepresentation" method to allow archiving/uncarchiving in * .plist formatted files. */ + (id) objectForSavedRepresentation: (NSString *)aSymbol; /*! @method adenosine @abstract Obtains a reference to the single adenosine representation */ + (BCNucleotideRNA *) adenosine; /*! @method uridine @abstract Obtains a reference to the single thymidine representation */ + (BCNucleotideRNA *) uridine; /*! @method cytidine @abstract Obtains a reference to the single cytidine representation */ + (BCNucleotideRNA *) cytidine; /*! @method guanidine @abstract Obtains a reference to the single guanidine representation */ + (BCNucleotideRNA *) guanidine; /*! @method anyBase @abstract Obtains a reference to the single N representation */ + (BCNucleotideRNA *) anyBase; /*! @method purine @abstract Obtains a reference to the single purine representation */ + (BCNucleotideRNA *) purine; /*! @method pyrimidine @abstract Obtains a reference to the single pyrimidine representation */ + (BCNucleotideRNA *) pyrimidine; /*! @method strong @abstract Obtains a reference to the single strong-bond representation */ + (BCNucleotideRNA *) strong; /*! @method weak @abstract Obtains a reference to the single weak-bond representation */ + (BCNucleotideRNA *) weak; /*! @method M @abstract Obtains a reference to the single M (A, C) representation */ + (BCNucleotideRNA *) amino; /*! @method K @abstract Obtains a reference to the single K (G, U) representation */ + (BCNucleotideRNA *) keto; /*! @method H @abstract Obtains a reference to the single H (A, C, U) representation */ + (BCNucleotideRNA *) H; /*! @method V @abstract Obtains a reference to the single V (A, C, G) representation */ + (BCNucleotideRNA *) V; /*! @method D @abstract Obtains a reference to the single D (A, G, U) representation */ + (BCNucleotideRNA *) D; /*! @method B @abstract Obtains a reference to the single D (C, G, U) representation */ + (BCNucleotideRNA *) B; /*! @method gap @abstract Obtains a reference to the single representation of a gap, for alignments */ + (BCNucleotideRNA *) gap; /*! @method undefined @abstract Obtains a reference to the single representation of any non-base character */ + (BCNucleotideRNA *) undefined; /*! @method customBase: @abstract Obtains a reference to a user-defined base */ + (BCNucleotideRNA *) customBase: (NSString *)baseName; #if 0 #pragma mark == OBJECT METHODS == #endif #if 0 #pragma mark == INITIALIZATION METHODS == #endif /*! @method initWithSymbolChar: @abstract designated initialization method @discussion Given a symbol, this method generates the appropriate Nucleotide representation using * information in the bundle's "base template.plist" file. */ - (id)initWithSymbolChar:(unsigned char)aChar; #if 0 #pragma mark == BASE INFORMATION METHODS == #endif /*! @method isBase @abstract Returns NO if the receiver is a gap or undefined */ - (BOOL) isBase; #if 0 #pragma mark == BASE RELATIONSHIP METHODS == #endif - (BCNucleotideDNA *) DNABaseEquivalent; @end biococoa-2.2.2/BCFoundation/BCSymbol/BCNucleotideRNA.m000644 000765 000024 00000040405 11370700423 022741 0ustar00scottcstaff000000 000000 // // BCNucleotideRNA.m // BioCocoa // // Created by John Timmer on 8/11/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCNucleotideRNA.h" #import "BCNucleotideDNA.h" static BCNucleotideRNA *adenosineRepresentation = nil; static BCNucleotideRNA *uridineRepresentation = nil; static BCNucleotideRNA *cytidineRepresentation = nil; static BCNucleotideRNA *guanidineRepresentation = nil; static BCNucleotideRNA *anyBaseRepresentation = nil; static BCNucleotideRNA *purineRepresentation = nil; static BCNucleotideRNA *pyrimidineRepresentation = nil; static BCNucleotideRNA *strongRepresentation = nil; static BCNucleotideRNA *weakRepresentation = nil; static BCNucleotideRNA *aminoRepresentation = nil; static BCNucleotideRNA *ketoRepresentation = nil; static BCNucleotideRNA *HRepresentation = nil; static BCNucleotideRNA *VRepresentation = nil; static BCNucleotideRNA *DRepresentation = nil; static BCNucleotideRNA *BRepresentation = nil; static BCNucleotideRNA *gapRepresentation = nil; static BCNucleotideRNA *undefinedRepresentation = nil; static NSMutableDictionary *customBases = nil; @implementation BCNucleotideRNA #if 0 #pragma mark CLASS METHODS #endif //////////////////////////////////////////////////////////////////////////// // THIS METHOD CREATES THE SINGLETON REFERENCES TO ALL THE STANDARD BASES //////////////////////////////////////////////////////////////////////////// + (void) initBases { // FIND OUR BUNDLE AND LOAD UP THE BASE DEFINITIONS NSBundle *biococoaBundle = [NSBundle bundleForClass: [BCNucleotideRNA class]]; NSString *filePath = [biococoaBundle pathForResource: @"nucleotides" ofType: @"plist"]; if ( filePath == nil ) return; NSStringEncoding enc; NSError *error; NSMutableString *tempString = [NSMutableString stringWithContentsOfFile: filePath usedEncoding: &enc error: &error]; // we adapt the DNA setup for use as RNA by replacing the thymidines with uridines [tempString replaceOccurrencesOfString: @">T<" withString: @">U<" options: NSLiteralSearch range: NSMakeRange(0, [tempString length])]; [tempString replaceOccurrencesOfString: @"thymidine" withString: @"uridine" options: NSLiteralSearch range: NSMakeRange(0, [tempString length])]; NSMutableDictionary *baseDefinitions = [tempString propertyList]; if ( baseDefinitions == nil ) return; customBases = [baseDefinitions retain]; // GO THROUGH AND CREATE EACH SINGLETON BASE DEFINITION, USING THE DICTIONARY NSDictionary *tempDict = [baseDefinitions objectForKey: @"A"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { adenosineRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'A']; [baseDefinitions removeObjectForKey: @"A"]; } tempDict = [baseDefinitions objectForKey: @"U"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { uridineRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'U']; [baseDefinitions removeObjectForKey: @"U"]; } tempDict = [baseDefinitions objectForKey: @"C"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { cytidineRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'C']; [baseDefinitions removeObjectForKey: @"C"]; } tempDict = [baseDefinitions objectForKey: @"G"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { guanidineRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'G']; [baseDefinitions removeObjectForKey: @"G"]; } tempDict = [baseDefinitions objectForKey: @"N"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { anyBaseRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'N']; [baseDefinitions removeObjectForKey: @"N"]; } tempDict = [baseDefinitions objectForKey: @"R"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { purineRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'R']; [baseDefinitions removeObjectForKey: @"R"]; } tempDict = [baseDefinitions objectForKey: @"Y"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { pyrimidineRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'Y']; [baseDefinitions removeObjectForKey: @"Y"]; } tempDict = [baseDefinitions objectForKey: @"S"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { strongRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'S']; [baseDefinitions removeObjectForKey: @"S"]; } tempDict = [baseDefinitions objectForKey: @"W"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { weakRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'W']; [baseDefinitions removeObjectForKey: @"W"]; } tempDict = [baseDefinitions objectForKey: @"M"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { aminoRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'M']; [baseDefinitions removeObjectForKey: @"M"]; } tempDict = [baseDefinitions objectForKey: @"K"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { ketoRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'K']; [baseDefinitions removeObjectForKey: @"K"]; } tempDict = [baseDefinitions objectForKey: @"H"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { HRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'H']; [baseDefinitions removeObjectForKey: @"H"]; } tempDict = [baseDefinitions objectForKey: @"V"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { VRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'V']; [baseDefinitions removeObjectForKey: @"V"]; } tempDict = [baseDefinitions objectForKey: @"D"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { DRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'D']; [baseDefinitions removeObjectForKey: @"D"]; } tempDict = [baseDefinitions objectForKey: @"B"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { BRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: 'B']; [baseDefinitions removeObjectForKey: @"B"]; } tempDict = [baseDefinitions objectForKey: @"-"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { gapRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: '-']; [baseDefinitions removeObjectForKey: @"-"]; } tempDict = [baseDefinitions objectForKey: @"?"]; if ( tempDict != nil && [tempDict isKindOfClass: [NSDictionary class]] ) { undefinedRepresentation = [[BCNucleotideRNA alloc] initWithSymbolChar: '?']; [baseDefinitions removeObjectForKey: @"?"]; } // hang on to the dictionary, in case there are custom bases customBases = [baseDefinitions retain]; } + (id) objectForSavedRepresentation: (NSString *)aSymbol { return [BCNucleotideRNA symbolForChar: [aSymbol characterAtIndex: 0]]; } //////////////////////////////////////////////////////////////////////////// // THE FOLLOWING IS A METHOD FOR OBTAINING REFERENCES TO THE // INDIVIDUAL BASE REPRESENTATIONS WHEN GIVEN A SINGLE LETTER CODE // // THIS WILL NOT WORK WITH CUSTOM BASES, SINCE THEIR SYMBOLS ARE NOT KNOWN IN ADVACE //////////////////////////////////////////////////////////////////////////// + (id) symbolForChar: (unsigned char)entry { switch ( entry ) { case 'A' : case 'a' : { return [BCNucleotideRNA adenosine]; break; } case 'U' : case 'u' : { return [BCNucleotideRNA uridine]; break; } case 'C' : case 'c' : { return [BCNucleotideRNA cytidine]; break; } case 'G' : case 'g' : { return [BCNucleotideRNA guanidine]; break; } case 'N' : case 'n' : { return [BCNucleotideRNA anyBase]; break; } case 'R' : case 'r' : { return [BCNucleotideRNA purine]; break; } case 'Y' : case 'y' : { return [BCNucleotideRNA pyrimidine]; break; } case 'W' : case 'w' : { return [BCNucleotideRNA weak]; break; } case 'S' : case 's' : { return [BCNucleotideRNA strong]; break; } case 'M' : case 'm' : { return [BCNucleotideRNA amino]; break; } case 'K' : case 'k' : { return [BCNucleotideRNA keto]; break; } case 'H' : case 'h' : { return [BCNucleotideRNA H]; break; } case 'V' : case 'v' : { return [BCNucleotideRNA V]; break; } case 'D' : case 'd' : { return [BCNucleotideRNA D]; break; } case 'B' : case 'b' : { return [BCNucleotideRNA B]; break; } case '-' : { return [BCNucleotideRNA gap]; break; } default : return [BCNucleotideRNA undefined]; } } //////////////////////////////////////////////////////////////////////////// // THE FOLLOWING ARE METHODS FOR OBTAINING REFERENCES TO THE // INDIVIDUAL BASE REPRESENTATIONS //////////////////////////////////////////////////////////////////////////// + (BCNucleotideRNA *) adenosine { if ( adenosineRepresentation == nil ) [BCNucleotideRNA initBases]; return adenosineRepresentation; } + (BCNucleotideRNA *) uridine { if ( uridineRepresentation == nil ) [BCNucleotideRNA initBases]; return uridineRepresentation; } + (BCNucleotideRNA *) cytidine { if ( cytidineRepresentation == nil ) [BCNucleotideRNA initBases]; return cytidineRepresentation; } + (BCNucleotideRNA *) guanidine { if ( guanidineRepresentation == nil ) [BCNucleotideRNA initBases]; return guanidineRepresentation; } + (BCNucleotideRNA *) anyBase { if ( anyBaseRepresentation == nil ) [BCNucleotideRNA initBases]; return anyBaseRepresentation; } + (BCNucleotideRNA *) purine { if ( purineRepresentation == nil ) [BCNucleotideRNA initBases]; return purineRepresentation; } + (BCNucleotideRNA *) pyrimidine { if ( pyrimidineRepresentation == nil ) [BCNucleotideRNA initBases]; return pyrimidineRepresentation; } + (BCNucleotideRNA *) strong { if ( strongRepresentation == nil ) [BCNucleotideRNA initBases]; return strongRepresentation; } + (BCNucleotideRNA *) weak { if ( weakRepresentation == nil ) [BCNucleotideRNA initBases]; return weakRepresentation; } + (BCNucleotideRNA *) amino { if ( aminoRepresentation == nil ) [BCNucleotideRNA initBases]; return aminoRepresentation; } + (BCNucleotideRNA *) keto { if ( ketoRepresentation == nil ) [BCNucleotideRNA initBases]; return ketoRepresentation; } + (BCNucleotideRNA *) H { if ( HRepresentation == nil ) [BCNucleotideRNA initBases]; return HRepresentation; } + (BCNucleotideRNA *) V { if ( VRepresentation == nil ) [BCNucleotideRNA initBases]; return VRepresentation; } + (BCNucleotideRNA *) D { if ( DRepresentation == nil ) [BCNucleotideRNA initBases]; return DRepresentation; } + (BCNucleotideRNA *) B { if ( BRepresentation == nil ) [BCNucleotideRNA initBases]; return BRepresentation; } + (BCNucleotideRNA *) gap { if ( gapRepresentation == nil ) [BCNucleotideRNA initBases]; return gapRepresentation; } + (BCNucleotideRNA *) undefined { if ( undefinedRepresentation == nil ) [BCNucleotideRNA initBases]; return undefinedRepresentation; } + (BCNucleotideRNA *) customBase: (NSString *)baseName { if ( customBases == nil ) [BCNucleotideRNA initBases]; id aBase = [customBases objectForKey: baseName]; if ( aBase == nil) return nil; if ( [aBase isKindOfClass: [BCNucleotideRNA class]] ) return aBase; if ( [aBase isKindOfClass: [NSDictionary class]] ) { aBase = [[[BCNucleotideRNA alloc] initWithDictionary: aBase] autorelease]; if ( aBase != nil ) { [customBases setObject: aBase forKey: baseName]; return aBase; } } return nil; } //////////////////////////////////////////////////////////////////////////// // OBJECT METHODS //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark OBJECT METHODS #pragma mark #pragma mark INITIALIZATION METHODS #endif - (id) initWithSymbolChar: (unsigned char)aSymbol { self = [super initWithSymbolChar: aSymbol]; if ( self == nil ) return nil; // we hang onto the dictionary in order to establish complement realtionships // once all the bases are generated symbolInfo = [[customBases objectForKey: symbolString] copy]; // get basic information about this base name = [symbolInfo objectForKey: @"Name"]; if (name == nil) return nil; else [name retain]; [self setMonoisotopicMass: [[symbolInfo objectForKey:@"MonoisotopicMass"] floatValue]]; [self setAverageMass: [[symbolInfo objectForKey:@"AverageMass"] floatValue]]; return self; } #if 0 #pragma mark BASE INFORMATION METHODS #endif - (BOOL) isBase { if ( self == [BCNucleotideRNA gap] || self == [BCNucleotideRNA undefined] ) return NO; return YES; } #if 0 #pragma mark BASE RELATIONSHIP METHODS #endif /////////////////////////////////////////////////////////// // BASE RELATIONSHIP METHODS /////////////////////////////////////////////////////////// - (BCNucleotideDNA *) DNABaseEquivalent { if ( self != [BCNucleotideRNA uridine] ) return [BCNucleotideDNA performSelector: NSSelectorFromString( name )]; return [BCNucleotideDNA thymidine]; } @end biococoa-2.2.2/BCFoundation/BCSymbol/BCSymbol.h000644 000765 000024 00000026306 11223237412 021551 0ustar00scottcstaff000000 000000 // // BCSymbol.h // BioCocoa // // Created by Koen van der Drift on Sun Aug 15 2004. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Provides symbol representation of individual sequence elements (nucleotide, amino acid, etc.). */ #import #import "BCFoundationDefines.h" @class BCSymbolSet; /*! @class BCSymbol @abstract Superclass of all individual sequence elements (nucleotide, amino acid, etc.) @discussion This class should not be instantiated, but acts to provide some common methods * and variables that are used by all subclasses. */ @interface BCSymbol : NSObject { unsigned char symbolChar; NSString *name; NSString *symbolString; NSDictionary *symbolInfo; NSSet *represents; NSSet *representedBy; float monoisotopicMass; float averageMass; } #if 0 #pragma mark == INITIALIZATION METHODS == #endif /*! @method initWithSymbolChar: @abstract initializes a BCSymbol object using a single character. @discussion This method does nothing else, it only sets the symbol. * It's the subclass responsibility to setup all other variables */ - (id)initWithSymbolChar:(unsigned char)aChar; /*! @method initializeSymbolRelationships @abstract converts string-based selectors to symbol references @discussion After the initialization above, internal references to other symbols * (complement, representations, etc.) remain in string-based selector form. The first time * the actual reference is needed, this method will use the selectors to generate the actual * references to the symbols. */ - (void) initializeSymbolRelationships; #if 0 #pragma mark == OBJECT METHODS == #endif /*! @method name @abstract returns the chemical name of the object. @discussion returns the common chemical name for the represented object. * For a nucleotide with a symbol of 'A', this will return "Adenosine", while * for an amino acid with that symbol, it will return "Alanine". */ - (NSString *)name; /*! @method symbolChar @abstract returns the one letter symbol for the object @discussion Provides a unicode character symbol that represents the object. * These are the standard representations: nucleotides are ATCGNYR etc., amino acids * are ACDEF etc. Stop codons are represented with *, and gaps are represented with -. * If non-symbol items are allowed, they are represented by a ?. */ - (unsigned char) symbolChar; /*! @method symbolString @abstract returns the symbol as a single character string. @discussion The behavior is identical to that for the "symbol" method above, except the * value returned is an NSString, and so can be readily saved, appended to strings, etc. */ - (NSString *)symbolString; /*! @method savableRepresentation @abstract Returns the symbol string of the object. @discussion All BCSymbol classes implement this method to provide a standard way of * accessing their data in a format that can be stored in Apple .plist files within * arrays or dictionaries. Subclasses should provide a method of converting this information * back into the appropriate Symbol object. */ - (NSString *) savableRepresentation; /*! @method description @abstract Overrides NSObject's description - describes the object in string form @discussion In the default implementation, returns the name of the object. Useful primarily * for debugging. */ - (NSString *) description; /*! @method symbolInfo @abstract Returns the dictionary that was used to initialize the symbol information @discussion The default set of symbols (bases and amino acids) are generated from information stored in a .plist * file in dictionary form. Upon initialization, each symbol retrieves and retains this dictionary, which is * accessible by this method. Use of this method should be avoided; rather, use "valueForKey" to retrieve information * about a symbol from this dictionary. */ - (NSDictionary *) symbolInfo; /*! @method valueForKey: @abstract Retrieves a value from the symbolInfo dictionary @discussion The default set of symbols (bases and amino acids) are generated from information stored in dictionary form * in a .plist file. Upon initialization, each symbol retrieves and retains this dictionary. Most, if not all, * of the values in this dictionary (ie - monoisotopicMass) are accessible through defined methods. This method may * be used to retrieve those values which do not have specified methods. It returns nil if the key is not used. * For a list of valid keys and their defined equivalents, check the file "BCStringDefinitions" or the .plist files * in the "Symbol Templates" folder. * * This method is primarily designed to allow rapid addition of features to the symbols which are the foundation of * BioCocoa via editing of the included .plist files (in the "Symbol Templates" folder), rather than by code. * * NB - the valid keys in this dictionary may vary between releases of BioCocoa, and returned values should not be * assumed to be non-nil. */ - (id) valueForKey: (NSString *)aKey; /*! @method setValue:forKey: @abstract Non-functional method present for key-value coding compliance. @discussion The symbolInfo dictionary with which symbols are initialized is non-mutable in order to maintain these * objects in an internally consistent state. Therefore, this method cannot actually change values in this * dictionary. It is included only to allow Symbols to be key-value coding compliant. */ - (void) setValue: (id)aValue forKey: (NSString *)theKey; /*! @method monoisotopicMass @abstract Returns a float value containing the monoisotopic mass for this BCSymbol @discussion The monoisotopic mass is the mass calculated using the first * isotope of each element (eg 12C, 14N, 16O, etc) */ - (float)monoisotopicMass; /*! @method setMonoisotopicMass: @abstract Set the monoisotopic mass for this BCSymbol. @discussion The monoisotopic mass is the mass calculated using the first * isotope of each element (eg 12C, 14N, 16O, etc) */ - (void)setMonoisotopicMass:(float)value; /*! @method averageMass @abstract Returns a float value containing the average mass for this BCSymbol @discussion The average mass is the mass calculated averaging over all * isotopes of each element. */ - (float)averageMass; /*! @method setAverageMass: @abstract Set the average mass for this BCSymbol. @discussion The average mass is the mass calculated averaging over all * isotopes of each element. */ - (void)setAverageMass:(float)value; /*! @method massUsingType: @abstract Returns the mass of this BCSymbol @discussion aType defines if either the monoisotopic or average mass is returned */ - (float)massUsingType:(BCMassType) aType; /*! @method minMassUsingType: @abstract Returns the minimum mass for this BCSymbol @discussion This is used for ambiguous symbols which have a mass range, because they are represented * by different BCSymbols, each with their own mass. It will return the mass of the BCSymbol * with the lowest mass. * aType defines if either the monoisotopic or average mass is returned */ - (float)minMassUsingType:(BCMassType) aType; /*! @method maxMassUsingType: @abstract Returns the maximum mass for this BCSymbol @discussion This is used for ambiguous symbols which have a mass range, because they are represented * by different BCSymbols, each with their own mass. It will return the mass of the BCSymbol * with the highest mass. * aType defines if either the monoisotopic or average mass is returned */ - (float)maxMassUsingType:(BCMassType) aType; #if 0 #pragma mark == SYMBOL RELATIONSHIP METHODS == #endif /*! @method isCompoundSymbol @abstract indicates if symbol is a compound symbol */ - (BOOL)isCompoundSymbol; - (BOOL)isEqualToSymbol:(BCSymbol *)aSymbol; /*! @method representedSymbols @abstract returns an array containing all symbols represented by the receiver @discussion For instance, when called on adenosine, this method will return an array with a single item, adenosine. * When called on purine, it will return an array with adenosine and guanidine. */ - (NSSet *) representedSymbols; /*! @method representingSymbols @abstract returns an array with all symbols that may represent the receiver @discussion For instance, when called on adenosine, this method will return adenosine, * weak, any base, etc. */ - (NSSet *) representingSymbols; /*! @method representsSymbol: @abstract Evaluates whether the receiver represents the entry @discussion For instance, when called on adenosine, this method will return YES if the entry is adenosine, * It will return NO for anything else. * When called on weak, will return YES for adenosine and thymidine, but NO for anything else. */ - (BOOL) representsSymbol: (BCSymbol *) entry; /*! @method isRepresentedBySymbol: @abstract Evaluates whether the receiver is represented by the entry @discussion For instance, when called on adenosine, this method will return YES if the entry is adenosine, * weak, any base, etc. */ - (BOOL) isRepresentedBySymbol: (BCSymbol *) entry; /*! @method symbolSetWithRepresentedSymbols @abstract Returns a symbol set containing the symbols of all the symbols that are represented by the receiver. */ - (BCSymbolSet *)symbolSetOfRepresentedSymbols; /*! @method symbolSetWithRepresentedSymbols @abstract Returns a symbol set containing the symbols of all the symbols that represent by the receiver. */ - (BCSymbolSet *)symbolSetOfRepresentingSymbols; @end biococoa-2.2.2/BCFoundation/BCSymbol/BCSymbol.m000644 000765 000024 00000017721 11223237412 021557 0ustar00scottcstaff000000 000000 // // BCSymbol.m // BioCocoa // // Created by Koen van der Drift on Sun Aug 15 2004. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCSymbol.h" #import "BCSymbolSet.h" #import "BCUtilStrings.h" #import "BCStringDefinitions.h" #import "BCInternal.h" @implementation BCSymbol - (id)initWithSymbolChar:(unsigned char)aChar { if ( (self = [super init]) ) { symbolChar = aChar; symbolString = [[NSString stringWithBytes: &aChar length: 1 encoding: NSUTF8StringEncoding] retain]; symbolInfo = nil; represents = nil; representedBy = nil; } return self; } - (void) initializeSymbolRelationships { // THIS METHOD IS CALLED AFTER OBJECT INITIALIZATION BECAUSE IT // REQUIRES THE EXISTENCE OF ALL THE OTHER SYMBOLS IN ORDER TO WORK // IT SHOULD BE CALLED THE FIRST TIME ONE OF THESE INSTANCE OBJECTS IS NEEDED NSString *symbolReference; NSArray *infoArray; NSEnumerator *objectEnumerator; NSMutableArray *tempArray; BCSymbol *tempSymbol; infoArray = [[self symbolInfo] objectForKey: BCSymbolRepresentsProperty]; if ( infoArray != nil || [infoArray count] > 0 ) { objectEnumerator = [infoArray objectEnumerator]; tempArray = [NSMutableArray array]; while ( (symbolReference = [objectEnumerator nextObject]) ) { if ( symbolReference != nil || [symbolReference length] > 0 ) { tempSymbol = [(BCSymbol*)[self class] performSelector: NSSelectorFromString( symbolReference )]; if ( tempSymbol != nil ) [tempArray addObject: tempSymbol]; } } represents = [[NSSet setWithArray: tempArray] retain]; } infoArray = [[self symbolInfo] objectForKey: BCSymbolRepresentedByProperty]; if ( infoArray != nil || [infoArray count] > 0 ) { objectEnumerator = [infoArray objectEnumerator]; tempArray = [NSMutableArray array]; while ( (symbolReference = [objectEnumerator nextObject]) ) { if ( symbolReference != nil || [symbolReference length] > 0 ) { tempSymbol = [(BCSymbol*)[self class] performSelector: NSSelectorFromString( symbolReference )]; if ( tempSymbol != nil ) [tempArray addObject: tempSymbol]; } } representedBy = [[NSSet setWithArray: tempArray] retain]; } } - (void)dealloc { [represents release]; [representedBy release]; [name release]; [symbolString release]; [symbolInfo release]; [super dealloc]; } - (id)copyWithZone:(NSZone *)zone { return self; } - (NSString *) name{ return [[name copy] autorelease]; } - (unsigned char) symbolChar { return symbolChar; } - (NSString *)symbolString { // return [[symbolString copy] autorelease]; return symbolString; } - (NSString *) savableRepresentation { return [self symbolString]; } - (NSString *) description { return [self name]; } - (NSDictionary *) symbolInfo { return symbolInfo; } - (id) valueForKey: (NSString *)aKey { return [symbolInfo objectForKey: aKey]; } - (void) setValue: (id)aValue forKey: (NSString *)theKey { return; } - (float)monoisotopicMass { return monoisotopicMass; } - (void)setMonoisotopicMass:(float)value { monoisotopicMass = value; } - (float)averageMass { return averageMass; } - (void)setAverageMass:(float)value { averageMass = value; } - (float)massUsingType:(BCMassType) aType { if ( aType == BCMonoisotopic ) return [self monoisotopicMass]; else if ( aType == BCAverage ) return [self averageMass]; return 0; } - (float)minMassUsingType:(BCMassType) aType { if ([represents count] == 1) { return [self massUsingType: aType]; } else { float tempMin, symbolMass; DECLARE_INDEX(j); NSArray *representedSymbols; BCSymbol *aSymbol; representedSymbols = [[self representedSymbols] allObjects]; aSymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(representedSymbols, 0); tempMin = [aSymbol massUsingType:aType]; for ( j = 1; j < [representedSymbols count]; j++ ) { aSymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(representedSymbols, j); symbolMass = [aSymbol massUsingType:aType]; if ( symbolMass ) { tempMin = ( tempMin < symbolMass ? tempMin : symbolMass ); } } return tempMin; } } - (float)maxMassUsingType:(BCMassType) aType { if ([represents count] == 1) { return [self massUsingType: aType]; } else { float tempMax, symbolMass; DECLARE_INDEX(j); NSArray *representedSymbols; BCSymbol *aSymbol; representedSymbols = [[self representedSymbols] allObjects]; aSymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(representedSymbols, 0); tempMax = [aSymbol massUsingType:aType]; for ( j = 1; j < [representedSymbols count]; j++ ) { aSymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(representedSymbols, j); symbolMass = [aSymbol massUsingType:aType]; if ( symbolMass ) { tempMax = ( tempMax > symbolMass ? tempMax : symbolMass ); } } return tempMax; } } - (BOOL)isEqualToSymbol:(BCSymbol *)aSymbol { return (self == aSymbol); } -(BOOL) isCompoundSymbol { if ( [represents count] > 1 ) return YES; return NO; } #if 0 #pragma mark SYMBOL RELATIONSHIP METHODS #endif /////////////////////////////////////////////////////////// // REPRESENTATION METHODS FOR AMBIGUOUS SYMBOLS /////////////////////////////////////////////////////////// - (NSSet *) representedSymbols { if ( represents == nil ) [self initializeSymbolRelationships]; return [[represents copy] autorelease]; } - (NSSet *) representingSymbols { if ( representedBy == nil ) [self initializeSymbolRelationships]; return [[representedBy copy] autorelease]; } - (BOOL) representsSymbol: (BCSymbol *) entry { if ( represents == nil ) [self initializeSymbolRelationships]; // the following is the equivalent of return [represents containsObject: entry]; return SET_CONTAINS_VALUE(represents, entry); } - (BOOL) isRepresentedBySymbol: (BCSymbol *) entry { if ( representedBy == nil ) [self initializeSymbolRelationships]; // the following is the equivalent of return [representedBy containsObject: entry]; return SET_CONTAINS_VALUE(representedBy, entry); } - (BCSymbolSet *)symbolSetOfRepresentedSymbols { if ( represents == nil ) [self initializeSymbolRelationships]; return [BCSymbolSet symbolSetWithArray: [represents allObjects]]; } - (BCSymbolSet *)symbolSetOfRepresentingSymbols { if ( representedBy == nil ) [self initializeSymbolRelationships]; return [BCSymbolSet symbolSetWithArray: [representedBy allObjects]]; } //- (BOOL) isRepresentedBySymbol: (BCSymbol *) aSymbol //{ // return YES; //} @end biococoa-2.2.2/BCFoundation/BCSymbol/BCSymbolSet.h000644 000765 000024 00000015034 11223237412 022221 0ustar00scottcstaff000000 000000 // // BCSymbolSet.h // BioCocoa // // Created by Alexander Griekspoor on Fri Sep 10 2004. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract A collection of BCSymbols of the same type. */ #import #import "BCFoundationDefines.h" @class BCSymbol; /*! @class BCSymbolSet @abstract A collection of BCSymbols of the same type @discussion BCSymbolSet objects provide a lot of flexibility for the user * of the framework when creating and manipulating sequence objects. * They can be thought of as filters, by restricting a sequence object * to a certain set of symbols. For instance, a dna sequence could be * created that will only accept the non-ambiguous bases A, T, G, C * but not the compound symbols like P and Y. * * BCSymbolSet objects are immutable. The class object provides a number * of factory methods for prebuilt symbol sets such as * '+ (BCSymbolSet *)dnaSymbolSet' and '+ (BCSymbolSet *)dnaStrictSymbolSet'. * It is recommanded to use these methods when creating a symbol set * supported by the class. For other cases, a new BCSymbolSet can easily * be created from an array of symbols, or by combining existing symbol sets. * Because BCSymbolSet are immutable, new objects have to be created to * modify existing symbol sets. */ @interface BCSymbolSet : NSObject { NSSet *symbolSet; BCSequenceType sequenceType; } #if 0 #pragma mark == INITIALIZATION METHODS == #endif /*! @method initWithArray:sequenceType: @abstract initialize symbol set with an array of symbols and a sequence type @discussion Designated initializer. */ - (id)initWithArray:(NSArray *)symbols sequenceType:(BCSequenceType)type; /*! @method initWithArray: @abstract initialize symbol set with an array of symbols @discussion Decides the sequence type based on the first symbol in the passed array. */ - (id)initWithArray:(NSArray *)symbols; /*! @method initWithString:sequenceType: @abstract initialize symbol set with an array of symbols and a sequence type @discussion Initializes the symbol sets using a string, by scanning the characters and generating symbols of the right sequence type e.g. A --> Adenosine if sequence type is DNA, Alanine if protein */ - (id)initWithString:(NSString *)stringOfCharacters sequenceType:(BCSequenceType)type; //factory methods - return an autoreleased object + (BCSymbolSet *)symbolSetWithArray:(NSArray *)symbols; + (BCSymbolSet *)symbolSetWithArray:(NSArray *)symbols sequenceType:(BCSequenceType)type; + (BCSymbolSet *)symbolSetWithString:(NSString *)aString sequenceType:(BCSequenceType)type; + (BCSymbolSet *)symbolSetForSequenceType:(BCSequenceType)type; #if 0 #pragma mark == FACTORY METHODS FOR PREBUILT SETS == #endif + (BCSymbolSet *)dnaSymbolSet; + (BCSymbolSet *)dnaStrictSymbolSet; + (BCSymbolSet *)rnaSymbolSet; + (BCSymbolSet *)rnaStrictSymbolSet; + (BCSymbolSet *)proteinSymbolSet; + (BCSymbolSet *)proteinStrictSymbolSet; + (BCSymbolSet *)unknownSymbolSet; + (BCSymbolSet *)unknownAndGapSymbolSet; #if 0 #pragma mark == GENERAL METHODS == #endif - (NSSet *)symbolSet; - (NSArray *)allSymbols; - (NSCharacterSet *)characterSetRepresentation; - (NSString *)stringRepresentation; - (BCSequenceType)sequenceType; - (BOOL)containsCharactersFromString: (NSString *) aString; - (BOOL)containsSymbol:(BCSymbol *)aSymbol; // aSymbol=W and contains A --> no - (BOOL)containsSymbolRepresentedBy:(BCSymbol *)aSymbol; // aSymbol=W and contains A --> yes - (BOOL)containsAllSymbolsRepresentedBy:(BCSymbol *)aSymbol; // aSymbol=W and contains A,T --> yes - (BOOL)containsSymbolRepresenting:(BCSymbol *)aSymbol; // aSymbol=A and contains W --> yes //creating new symbol sets from existing ones - (BCSymbolSet *)symbolSetByFormingUnionWithSymbolSet:(BCSymbolSet *)otherSet; - (BCSymbolSet *)symbolSetByFormingIntersectionWithSymbolSet:(BCSymbolSet *)otherSet; /* TO DO (or not to do?) - (BCSymbolSet *)complementSet; - (BCSymbolSet *)expandedSet; // ambigous symbols expanded */ - (BOOL)isSupersetOfSet:(BCSymbolSet *)theOtherSet; //filtering an array of symbols //returned array = without the unknown symbols - (NSArray *)arrayByRemovingUnknownSymbolsFromArray:(NSArray *)anArray; - (NSString *)stringByRemovingUnknownCharsFromString:(NSString *)aString; - (NSData *)dataByRemovingUnknownCharsFromData:(NSData *)aData; //returns nil if symbol unknown - (BCSymbol *)symbolForChar:(unsigned char)aChar; //NSCopying formal protocol - (id)copyWithZone:(NSZone *)zone; //BCSymbolSet is immutable //Keep this for a future BCMutableSymbolSet, if ever needed /* //////////////////////////////////////////////////////////////////////////// // #pragma mark #pragma mark MUTABILITY METHODS // // MUTABILITY METHODS //////////////////////////////////////////////////////////////////////////// - (void)addSymbol:(BCSymbol *)symbol; - (void)addSymbols:(NSArray *)symbols; - (void)addSymbolsInString:(NSString *)aString; - (void)removeSymbol:(BCSymbol *)symbol; - (void)removeSymbols:(NSArray *)symbols; - (void)removeSymbolsInString:(NSString *)aString; - (void)formUnionWithSymbolSet:(BCSymbolSet *)otherSet; - (void)formIntersectionWithSymbolSet:(BCSymbolSet *)otherSet; - (void)makeComplementary; */ @end biococoa-2.2.2/BCFoundation/BCSymbol/BCSymbolSet.m000644 000765 000024 00000063344 11223237412 022235 0ustar00scottcstaff000000 000000 // // BCSymbolSet.m // BioCocoa // // Created by Alexander Griekspoor on Fri Sep 10 2004. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCSymbolSet.h" #import "BCSymbol.h" #import "BCNucleotideDNA.h" #import "BCNucleotideRNA.h" #import "BCAminoAcid.h" #import "BCUtilStrings.h" static BCSymbolSet *dnaSymbolSetRepresentation = nil; static BCSymbolSet *dnaStrictSymbolSetRepresentation = nil; static BCSymbolSet *rnaSymbolSetRepresentation = nil; static BCSymbolSet *rnaStrictSymbolSetRepresentation = nil; static BCSymbolSet *proteinSymbolSetRepresentation = nil; static BCSymbolSet *proteinStrictSymbolSetRepresentation = nil; static BCSymbolSet *unknownSymbolSetRepresentation = nil; static BCSymbolSet *unknownAndGapSymbolSetRepresentation = nil; // From NSSet documentation: // Objects in a set must respond to the NSObject protocol methods hash and isEqual:. // See the NSObject protocol for more information. @implementation BCSymbolSet // //THIS IS A FUNCTION ! (as opposed to a method...) //returns the sequence type of a given symbol, based on its class //called by various symbolSet methods to check the validity of a symbol //(TO DO : symbols should have a sequence type ?) BCSequenceType SequenceTypeOfSymbol(BCSymbol *aSymbol) { if ([aSymbol isKindOfClass:[BCNucleotideDNA class]]) return BCSequenceTypeDNA; else if ([aSymbol isKindOfClass:[BCNucleotideRNA class]]) return BCSequenceTypeRNA; else if ([aSymbol isKindOfClass:[BCAminoAcid class]]) return BCSequenceTypeProtein; else return BCSequenceTypeOther; } //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark INITIALIZATION METHODS #endif //////////////////////////////////////////////////////////////////////////// - (id)initWithArray:(NSArray *)symbols sequenceType:(BCSequenceType)type { NSEnumerator *e; BCSymbol *aSymbol; NSMutableSet *aSet; if ( (self = [super init]) ) { sequenceType=type; aSet=[NSMutableSet setWithCapacity:[symbols count]]; e=[symbols objectEnumerator]; while ( (aSymbol=[e nextObject]) ) { //(TO DO : symbols should have a sequence type ?) if (SequenceTypeOfSymbol(aSymbol)==sequenceType) [aSet addObject:aSymbol]; } symbolSet=[[NSMutableSet alloc] initWithSet:aSet]; } return self; } //initializes the symbol sets using the string --> character set --> symbols //very useful for the factory methods for the prebuilt sets // ** NOTE : works only for symbols with stringRepresentation length = 1 ** - (id)initWithString:(NSString *)stringOfCharacters sequenceType:(BCSequenceType)type { int i,n; NSMutableArray *symbolArray; unsigned char oneChar; BCSymbol *oneSymbol; Class symbolClass=nil; //to create a new symbol from a character, you need to call a class method //so you need to know the class of BCSymbol to use //this class is determined by the sequence type passed as argument if (type==BCSequenceTypeDNA) symbolClass=[BCNucleotideDNA class]; else if (type==BCSequenceTypeRNA) symbolClass=[BCNucleotideRNA class]; else if (type==BCSequenceTypeProtein) symbolClass=[BCAminoAcid class]; else return [self initWithArray:[NSArray array] sequenceType:type]; //now loop over the characters in the passed string //to populate an array with BCSymbol objects n=[stringOfCharacters length]; symbolArray=[NSMutableArray arrayWithCapacity:n]; const char *utf8string = [stringOfCharacters UTF8String]; for (i=0;i0) guess=SequenceTypeOfSymbol([symbols objectAtIndex:0]); return [self initWithArray:symbols sequenceType:guess]; } - (id)init { return [self initWithArray:[NSArray array] sequenceType:BCSequenceTypeOther]; } - (void)dealloc { [symbolSet release]; [super dealloc]; } //BCSymbolSet is immutable, no need to copy anything //just retain and return self - (id)copyWithZone:(NSZone *)zone { return [self retain]; } + (BCSymbolSet *)symbolSetWithArray:(NSArray *)symbols { return [[[self alloc] initWithArray:symbols] autorelease]; } + (BCSymbolSet *)symbolSetWithArray:(NSArray *)symbols sequenceType:(BCSequenceType)type { return [[[self alloc] initWithArray:symbols sequenceType:type] autorelease]; } + (BCSymbolSet *)symbolSetWithString:(NSString *)aString sequenceType:(BCSequenceType)type { return [[[self alloc] initWithString:aString sequenceType:type] autorelease]; } + (BCSymbolSet *)symbolSetForSequenceType:(BCSequenceType)type { if ( type == BCSequenceTypeDNA ) return [self dnaSymbolSet]; else if ( type == BCSequenceTypeRNA ) return [self rnaSymbolSet]; else if ( type == BCSequenceTypeProtein ) return [self proteinSymbolSet]; else return [self unknownSymbolSet]; } //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark FACTORY METHODS FOR THE PREBUILT SETS #endif //////////////////////////////////////////////////////////////////////////// + (BCSymbolSet *)dnaSymbolSet { if ( dnaSymbolSetRepresentation == nil ) { dnaSymbolSetRepresentation = [[BCSymbolSet alloc] initWithString:@"ACGTRYMKSWHBVDN" sequenceType:BCSequenceTypeDNA]; } return dnaSymbolSetRepresentation; } + (BCSymbolSet *)dnaStrictSymbolSet { if ( dnaStrictSymbolSetRepresentation == nil ) { dnaStrictSymbolSetRepresentation = [[BCSymbolSet alloc] initWithString:@"ACGT" sequenceType:BCSequenceTypeDNA]; } return dnaStrictSymbolSetRepresentation; } + (BCSymbolSet *)rnaSymbolSet { if ( rnaSymbolSetRepresentation == nil ) { rnaSymbolSetRepresentation = [[BCSymbolSet alloc] initWithString:@"ACGURYMKSWHBVDN" sequenceType:BCSequenceTypeRNA]; } return rnaSymbolSetRepresentation; } + (BCSymbolSet *)rnaStrictSymbolSet { if ( rnaStrictSymbolSetRepresentation == nil ) { rnaStrictSymbolSetRepresentation = [[BCSymbolSet alloc] initWithString:@"ACGU" sequenceType:BCSequenceTypeRNA]; } return rnaStrictSymbolSetRepresentation; } + (BCSymbolSet *)proteinSymbolSet { if ( proteinSymbolSetRepresentation == nil ) { proteinSymbolSetRepresentation = [[BCSymbolSet alloc] initWithString:@"ACDEFGHIKLMNPQRSTVWYBZ" sequenceType:BCSequenceTypeProtein]; } return proteinSymbolSetRepresentation; } + (BCSymbolSet *)proteinStrictSymbolSet { if ( proteinStrictSymbolSetRepresentation == nil ) { proteinStrictSymbolSetRepresentation = [[BCSymbolSet alloc] initWithString:@"ACDEFGHIKLMNPQRSTVWY" sequenceType:BCSequenceTypeProtein]; } return proteinStrictSymbolSetRepresentation; } + (BCSymbolSet *)unknownSymbolSet // is this aa or base ??? { if ( unknownSymbolSetRepresentation == nil ) { unknownSymbolSetRepresentation = [[BCSymbolSet alloc] initWithArray:[NSArray array] sequenceType:BCSequenceTypeOther]; } return unknownSymbolSetRepresentation; } + (BCSymbolSet *)unknownAndGapSymbolSet // is this aa or base ??? { if ( unknownAndGapSymbolSetRepresentation == nil ) { unknownAndGapSymbolSetRepresentation = [self unknownSymbolSet]; } return unknownAndGapSymbolSetRepresentation; } //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark CREATING NEW SYMBOL SETS #endif //////////////////////////////////////////////////////////////////////////// - (BCSymbolSet *)symbolSetByFormingUnionWithSymbolSet:(BCSymbolSet *)otherSet { NSMutableSet *temp; //cases where we don't need to create a new object if ( (sequenceType!=[otherSet sequenceType]) || [symbolSet isSubsetOfSet:[otherSet symbolSet]] || [[otherSet symbolSet] isSubsetOfSet:symbolSet] ) return self; //create a temporary NSSet to form the union temp=[NSMutableSet setWithSet:symbolSet]; [temp unionSet:[otherSet symbolSet]]; return [[self class] symbolSetWithArray:[temp allObjects] sequenceType:sequenceType]; } - (BCSymbolSet *)symbolSetByFormingIntersectionWithSymbolSet:(BCSymbolSet *)otherSet { NSMutableSet *temp; //cases where we don't need to create a new object if ( (sequenceType!=[otherSet sequenceType]) || [symbolSet isSubsetOfSet:[otherSet symbolSet]] || [[otherSet symbolSet] isSubsetOfSet:symbolSet] ) return self; temp=[NSMutableSet setWithSet:symbolSet]; [temp intersectSet:[otherSet symbolSet]]; return [[self class] symbolSetWithArray:[temp allObjects] sequenceType:sequenceType]; } /* - (BCSymbolSet *)complementSet { } - (BCSymbolSet *)expandedSet { // ambigous symbols expanded } */ //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark SYMBOL SETS IN OTHERS FORMATS #endif //////////////////////////////////////////////////////////////////////////// - (NSSet *)symbolSet { return [[symbolSet copy] autorelease]; } - (NSArray *)allSymbols { return [symbolSet allObjects]; } - (NSCharacterSet *)characterSetRepresentation { NSMutableString *symbols = [NSMutableString string]; NSEnumerator *symbolEnumerator = [[self symbolSet] objectEnumerator]; BCSymbol *symbol; while ( (symbol = [symbolEnumerator nextObject]) ) { [symbols appendString: [symbol symbolString]]; } return [NSCharacterSet characterSetWithCharactersInString:symbols]; } //string = concatenated characters corresponding to the symbols //e.g. [dnaSrictSymbolSet stringRepresentation] = @"ATGC" (not sure about the order) - (NSString*)stringRepresentation { NSMutableString *symbols = [NSMutableString string]; NSEnumerator *symbolEnumerator = [symbolSet objectEnumerator]; BCSymbol *symbol; while ( (symbol = [symbolEnumerator nextObject]) ) [symbols appendString: [symbol symbolString]]; return [NSString stringWithString:symbols]; } //description is e.g. // =ATCG(DNA) - (NSString *)description { NSString *type; if (sequenceType==BCSequenceTypeDNA) type=@"DNA"; else if (sequenceType==BCSequenceTypeRNA) type=@"RNA"; else if (sequenceType==BCSequenceTypeProtein) type=@"Protein"; else type=@"unknown type"; return [NSString stringWithFormat:@"<%@:%p>=%@(%@)", [self class], self, [self stringRepresentation], type]; } //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark FILTERING SYMBOLS WITH SYMBOL SETS #endif //////////////////////////////////////////////////////////////////////////// - (NSArray *)arrayByRemovingUnknownSymbolsFromArray:(NSArray *)anArray { NSEnumerator *e; BCSymbol *aSymbol; NSMutableArray *result; result=[NSMutableArray arrayWithCapacity:[anArray count]]; e=[anArray objectEnumerator]; while ( (aSymbol=[e nextObject]) ) { if ([symbolSet containsObject:aSymbol]) [result addObject:aSymbol]; } return [NSArray arrayWithArray:result]; } - (NSString *)stringByRemovingUnknownCharsFromString:(NSString *)aString { int i, len; unsigned char c; NSMutableString *result = [NSMutableString stringWithCapacity: [aString length]]; const char *utfString = [aString UTF8String]; len = strlen(utfString); for ( i = 0; i < len; i++ ) { c = utfString[i]; if ([self containsSymbol: [self symbolForChar: c]]) { [result appendString: [NSString stringWithBytes: (const void *) &c length: 1 encoding: NSUTF8StringEncoding]]; } } return [NSString stringWithString:result]; } - (NSData *)dataByRemovingUnknownCharsFromData:(NSData *)aData { NSMutableData *newData = [NSMutableData data]; const char *seqData = (const char *)[aData bytes]; unsigned i, len = [aData length]; for (i = 0; i < len; ++i) { if ([self containsSymbol: [self symbolForChar: seqData[i]]]) { [newData appendBytes: (const void *) &(seqData[i]) length: 1]; } } return newData; } //maybe that should be cached in the future?? //the implementation of this method somehow defeats the symbol set design... - (BCSymbol *)symbolForChar:(unsigned char)aChar { Class symbolClass; BCSymbol *result; //to create a new symbol from a character, you need to call a class method //so you need to know the class of BCSymbol to use //this class is determined by the sequence type passed as argument if (sequenceType==BCSequenceTypeDNA) symbolClass=[BCNucleotideDNA class]; else if (sequenceType==BCSequenceTypeRNA) symbolClass=[BCNucleotideRNA class]; else if (sequenceType==BCSequenceTypeProtein) symbolClass=[BCAminoAcid class]; else return nil; //Now use that class to get the symbol //and check if it is in the symbol set result=[symbolClass symbolForChar:aChar]; if ([symbolSet containsObject:result]) return result; else return nil; } //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark EXPLORING SYMBOL SETS #endif //////////////////////////////////////////////////////////////////////////// - (BCSequenceType)sequenceType { return sequenceType; } // aSymbol=W and contains A --> no - (BOOL)containsSymbol:(BCSymbol *)aSymbol { return [symbolSet containsObject:aSymbol]; } // aSymbol=W and contains A --> yes - (BOOL)containsSymbolRepresentedBy:(BCSymbol *)aSymbol { return [symbolSet intersectsSet:[[aSymbol symbolSetOfRepresentedSymbols] symbolSet]]; } // aSymbol=W and contains A,T --> yes - (BOOL)containsAllSymbolsRepresentedBy:(BCSymbol *)aSymbol { NSSet *representedSymbols=[[aSymbol symbolSetOfRepresentedSymbols] symbolSet]; return [representedSymbols isSubsetOfSet:symbolSet]; } // aSymbol=A and contains W --> yes - (BOOL)containsSymbolRepresenting:(BCSymbol *)aSymbol { NSSet *representingSymbols=[[aSymbol symbolSetOfRepresentingSymbols] symbolSet]; return [representingSymbols isSubsetOfSet:symbolSet]; } -(BOOL)containsCharactersFromString: (NSString *) aString { int i, len; unsigned char c; const char *utfString = [aString UTF8String]; len = strlen(utfString); // return NO if we find a character that is not part of the symbolset // useful for validating an input for ( i = 0; i < len; i++ ) { c = utfString[i]; if (![self containsSymbol: [self symbolForChar: c]]) { return NO; } } return YES; } - (BOOL)isSupersetOfSet:(BCSymbolSet *)theOtherSet { return [[theOtherSet symbolSet] isSubsetOfSet: [self symbolSet]]; } //The old versions of the factory methods for the prebuilt sets /* //////////////////////////////////////////////////////////////////////////// #pragma mark #pragma mark FACTORY METHODS FOR THE PREBUILT SETS //////////////////////////////////////////////////////////////////////////// //this method should temporarily be used for the prebuilt symbol sets //it is not meant to be public //the prebuil sets should eventually use the designated initializer instead - (void)setSequenceType:(BCSequenceType)type { sequenceType=type; } + (BCSymbolSet *)dnaSymbolSet { if ( dnaSymbolSetRepresentation == nil ) { dnaSymbolSetRepresentation = [[BCSymbolSet alloc] init]; [dnaSymbolSetRepresentation setSequenceType:BCSequenceTypeDNA]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'A']]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'C']]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'G']]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'T']]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'R']]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'Y']]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'M']]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'K']]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'S']]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'W']]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'H']]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'B']]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'V']]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'D']]; [dnaSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'N']]; } return dnaSymbolSetRepresentation; } + (BCSymbolSet *)dnaStrictSymbolSet { if ( dnaStrictSymbolSetRepresentation == nil ) { dnaStrictSymbolSetRepresentation = [[BCSymbolSet alloc] init]; [dnaStrictSymbolSetRepresentation setSequenceType:BCSequenceTypeDNA]; [dnaStrictSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'A']]; [dnaStrictSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'C']]; [dnaStrictSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'G']]; [dnaStrictSymbolSetRepresentation addSymbol: [BCNucleotideDNA symbolForChar: 'T']]; } return dnaStrictSymbolSetRepresentation; } + (BCSymbolSet *)rnaSymbolSet { if ( rnaSymbolSetRepresentation == nil ) { rnaSymbolSetRepresentation = [[BCSymbolSet alloc] init]; [rnaSymbolSetRepresentation setSequenceType:BCSequenceTypeRNA]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'A']]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'C']]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'G']]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'T']]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'R']]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'Y']]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'M']]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'K']]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'S']]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'W']]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'H']]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'B']]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'V']]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'D']]; [rnaSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'N']]; } return dnaSymbolSetRepresentation; } + (BCSymbolSet *)rnaStrictSymbolSet { if ( rnaStrictSymbolSetRepresentation == nil ) { rnaStrictSymbolSetRepresentation = [[BCSymbolSet alloc] init]; [rnaStrictSymbolSetRepresentation setSequenceType:BCSequenceTypeRNA]; [rnaStrictSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'A']]; [rnaStrictSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'C']]; [rnaStrictSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'G']]; [rnaStrictSymbolSetRepresentation addSymbol: [BCNucleotideRNA symbolForChar: 'T']]; } return rnaStrictSymbolSetRepresentation; } + (BCSymbolSet *)proteinSymbolSet { if ( proteinSymbolSetRepresentation == nil ) { proteinSymbolSetRepresentation = [[BCSymbolSet alloc] init]; [proteinSymbolSetRepresentation setSequenceType:BCSequenceTypeProtein]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'A']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'C']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'D']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'E']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'F']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'G']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'H']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'I']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'K']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'L']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'M']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'N']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'P']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'Q']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'R']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'S']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'T']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'V']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'W']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'Y']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'B']]; [proteinSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'Z']]; } return proteinSymbolSetRepresentation; } + (BCSymbolSet *)proteinStrictSymbolSet { if ( proteinStrictSymbolSetRepresentation == nil ) { proteinStrictSymbolSetRepresentation = [[BCSymbolSet alloc] init]; [proteinStrictSymbolSetRepresentation setSequenceType:BCSequenceTypeProtein]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'A']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'C']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'D']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'E']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'F']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'G']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'H']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'I']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'K']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'L']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'M']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'N']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'P']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'Q']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'R']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'S']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'T']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'V']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'W']]; [proteinStrictSymbolSetRepresentation addSymbol: [BCAminoAcid symbolForChar: 'Y']]; } return proteinStrictSymbolSetRepresentation; } + (BCSymbolSet *)unknownSymbolSet // is this aa or base ??? { if ( unknownSymbolSetRepresentation == nil ) { unknownSymbolSetRepresentation = [[BCSymbolSet alloc] init]; } return unknownSymbolSetRepresentation; } + (BCSymbolSet *)unknownAndGapSymbolSet // is this aa or base ??? { if ( unknownAndGapSymbolSetRepresentation == nil ) { unknownAndGapSymbolSetRepresentation = [[BCSymbolSet alloc] init]; } return unknownAndGapSymbolSetRepresentation; } */ //BCSymbolSet is immutable //Keep this for a future BCMutableSymbolSet, if ever needed /* //////////////////////////////////////////////////////////////////////////// #pragma mark #pragma mark MUTABILITY METHODS //////////////////////////////////////////////////////////////////////////// - (void)addSymbol:(BCSymbol *)symbol { [symbolSet addObject: symbol]; } - (void)addSymbols:(NSArray *)symbols { [symbolSet addObjectsFromArray: symbols]; } - (void)addSymbolsInString:(NSString *)aString { } - (void)removeSymbol:(BCSymbol *)symbol { [symbolSet removeObject: symbol]; } - (void)removeSymbols:(NSArray *)symbols { NSSet *temp = [NSSet setWithArray: symbols]; [symbolSet minusSet: temp]; } - (void)removeSymbolsInString:(NSString *)aString { } - (void)formUnionWithSymbolSet:(BCSymbolSet *)otherSet { [symbolSet unionSet: [otherSet symbolSet]]; } - (void)formIntersectionWithSymbolSet:(BCSymbolSet *)otherSet { [symbolSet intersectSet: [otherSet symbolSet]]; } - (void)makeComplementary { } */ @end biococoa-2.2.2/BCFoundation/BCSymbol/GNUmakefile000644 000765 000024 00000004071 11226023231 021766 0ustar00scottcstaff000000 000000 # # GNUmakefile # # Written by: Scott Christley # Copyright (c) 2003-2009 The BioCocoa Project. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # include $(GNUSTEP_MAKEFILES)/common.make # The library to be compiled SUBPROJECT_NAME = BCSymbol # The Objective-C source files to be compiled BCSymbol_OBJC_FILES = \ BCAminoAcid.m \ BCNucleotide.m \ BCSymbol.m \ BCNucleotideDNA.m \ BCNucleotideRNA.m \ BCSymbolSet.m # The header files BCSymbol_HEADER_FILES = \ BCAminoAcid.h \ BCNucleotide.h \ BCSymbol.h \ BCNucleotideDNA.h \ BCNucleotideRNA.h \ BCSymbolSet.h BIOCOCOA_BASE_DIR = .. -include $(BIOCOCOA_BASE_DIR)/GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble biococoa-2.2.2/BCFoundation/BCSymbol/SymbolTemplates/000755 000765 000024 00000000000 11455661314 023054 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/BCSymbol/SymbolTemplates/aminoacids.plist000644 000765 000024 00000031527 11070521237 026240 0ustar00scottcstaff000000 000000 A ThreeLetterCode Ala Name alanine MonoisotopicMass 71.03711 AverageMass 71.0788 pKa 0.0 KyteDoolittle 1.8 HoppWoods -0.5 Represents alanine Represented by alanine C ThreeLetterCode Cys Name cysteine MonoisotopicMass 103.00919 AverageMass 103.1448 pKa -8.3 KyteDoolittle 2.5 HoppWoods -1.0 Represents cysteine Represented by cysteine D ThreeLetterCode Asp Name asparticacid MonoisotopicMass 115.02694 AverageMass 115.0886 pKa -3.91 KyteDoolittle -3.5 HoppWoods 3.0 Represents asparticacid Represented by asparticacid asx R ThreeLetterCode Arg Name arginine MonoisotopicMass 156.10111 AverageMass 156.1876 pKa 12.50 KyteDoolittle -4.5 HoppWoods 3.0 Represents arginine Represented by arginine N ThreeLetterCode Asn Name asparagine MonoisotopicMass 114.04293 AverageMass 114.1039 pKa 0.0 KyteDoolittle -3.5 HoppWoods 0.2 Represents asparagine Represented by asparagine asx E ThreeLetterCode Glu Name glutamicacid MonoisotopicMass 129.04259 AverageMass 129.1155 pKa -4.25 KyteDoolittle -3.5 HoppWoods 3.0 Represents glutamicacid Represented by glutamicacid glx Q ThreeLetterCode Gln Name glutamine MonoisotopicMass 128.05858 AverageMass 128.1308 pKa 0.0 KyteDoolittle -3.5 HoppWoods 0.2 Represents glutamine Represented by glutamine glx G ThreeLetterCode Gly Name glycine MonoisotopicMass 57.02147 AverageMass 57.0520 pKa 0.0 KyteDoolittle -0.4 HoppWoods 0.0 Represents glycine Represented by glycine H ThreeLetterCode His Name histidine MonoisotopicMass 137.05891 AverageMass 137.1412 pKa 6.5 KyteDoolittle -3.2 HoppWoods -0.5 Represents histidine Represented by histidine I ThreeLetterCode Ile Name isoleucine MonoisotopicMass 113.08406 AverageMass 113.1595 pKa 0.0 KyteDoolittle 4.5 HoppWoods -1.8 Represents isoleucine Represented by isoleucine L ThreeLetterCode Leu Name leucine MonoisotopicMass 113.08406 AverageMass 113.1595 pKa 0.0 KyteDoolittle 3.8 HoppWoods -1.8 Represents leucine Represented by leucine K ThreeLetterCode Lys Name lysine MonoisotopicMass 128.09496 AverageMass 128.1742 pKa 10.79 KyteDoolittle -3.9 HoppWoods 3.0 Represents lysine Represented by lysine M ThreeLetterCode Met Name methionine MonoisotopicMass 131.04049 AverageMass 131.1986 pKa 0.0 KyteDoolittle 1.9 HoppWoods -1.3 Represents methionine Represented by methionine F ThreeLetterCode Phe Name phenylalanine MonoisotopicMass 147.06841 AverageMass 147.1766 pKa 0.0 KyteDoolittle 2.8 HoppWoods -2.5 Represents phenylalanine Represented by phenylalanine P ThreeLetterCode Pro Name proline MonoisotopicMass 97.05276 AverageMass 97.1167 pKa 0.0 KyteDoolittle -1.6 HoppWoods 0.0 Represents proline Represented by proline S ThreeLetterCode Ser Name serine MonoisotopicMass 87.03203 AverageMass 87.0782 pKa 0.0 KyteDoolittle -0.8 HoppWoods -0.3 Represents serine Represented by serine T ThreeLetterCode Thr Name threonine MonoisotopicMass 101.04768 AverageMass 101.1051 pKa 0.0 KyteDoolittle -0.7 HoppWoods -0.4 Represents threonine Represented by threonine W ThreeLetterCode Trp Name tryptophan MonoisotopicMass 186.07931 AverageMass 186.2133 pKa 0.0 KyteDoolittle -0.9 HoppWoods -3.4 Represents tryptophan Represented by tryptophan Y ThreeLetterCode Tyr Name tyrosine MonoisotopicMass 163.06333 AverageMass 163.1760 pKa -10.95 KyteDoolittle -1.3 HoppWoods -2.3 Represents tyrosine Represented by tyrosine V ThreeLetterCode Val Name valine MonoisotopicMass 99.06842 AverageMass 99.1326 pKa 0.0 KyteDoolittle 4.2 HoppWoods -1.5 Represents valine Represented by valine U ThreeLetterCode Sec Name selenocysteine MonoisotopicMass 166.9485 AverageMass 166.0382 pKa 0.0 KyteDoolittle -0.8 HoppWoods -0.3 Represents selenocysteine Represented by selenocysteine - ThreeLetterCode Gap Name gap MonoisotopicMass 0.0 AverageMass 0.0 pKa 0.0 KyteDoolittle 0.0 HoppWoods 0.0 Represents gap Represented by gap ? ThreeLetterCode Xaa Name undefined MonoisotopicMass 0.0 AverageMass 0.0 pKa 0.0 KyteDoolittle 0.0 HoppWoods 0.0 Represents undefined Represented by undefined B ThreeLetterCode Asx Name asx Represents asparagine asparticacid Represented by asx Z ThreeLetterCode Glx Name glx Represents glutamine glutamicacid Represented by glx biococoa-2.2.2/BCFoundation/BCSymbol/SymbolTemplates/nucleotides.plist000644 000765 000024 00000035271 10404057133 026446 0ustar00scottcstaff000000 000000 - All Complements gap Complement gap Name gap Represented by gap Represents gap Symbol - ? All Complements undefined AverageMass Complement undefined MonoisotopicMass Name undefined Represented by undefined Represents undefined Symbol ? A All Complements thymidine anyBase weak pyrimidine keto H B D AverageMass 313.2097 Complement thymidine MonoisotopicMass 313.05761 Name adenosine Represented by adenosine anyBase weak purine amino H V D Represents adenosine Symbol A B All Complements adenosine cytidine guanidine weak strong pyrimidine purine amino keto H V D B AverageMass Complement V MonoisotopicMass Name B Represented by B anyBase Represents thymidine cytidine guanidine keto pyrimidine strong B Symbol B C All Complements guanidine anyBase strong purine keto B V D AverageMass 289.1847 Complement guanidine MonoisotopicMass 289.04637 Name cytidine Represented by cytidine anyBase strong pyrimidine amino H B V Represents cytidine Symbol C D All Complements adenosine cytidine thymidine weak strong pyrimidine purine amino keto H V D B AverageMass Complement H MonoisotopicMass Name D Represented by D anyBase Represents thymidine adenosine guanidine keto purine weak D Symbol D G All Complements cytidine anyBase strong pyrimidine amino H B V AverageMass 329.2091 Complement cytidine MonoisotopicMass 329.05252 Name guanidine Represented by guanidine anyBase strong purine keto V D B Represents guanidine Symbol G H All Complements guanidine adenosine thymidine weak strong pyrimidine purine amino keto H V D B AverageMass Complement D MonoisotopicMass Name H Represented by H anyBase Represents cytidine adenosine thymidine amino pyrimidine weak H Symbol H K All Complements adenosine cytidine anyBase weak strong pyrimidine purine amino H V D B AverageMass Complement amino MonoisotopicMass Name keto Represented by keto anyBase D B Represents guanidine thymidine amino Symbol K M All Complements guanidine thymidine anyBase weak strong pyrimidine purine keto H V D B AverageMass Complement keto MonoisotopicMass Name amino Represented by amino anyBase H V Represents adenosine cytidine amino Symbol M N All Complements adenosine thymidine cytidine guanidine anyBase strong weak purine pyrimidine amino keto H B V D AverageMass Complement anyBase MonoisotopicMass Name any base Represented by anyBase Represents adenosine thymidine cytidine guanidine anyBase strong weak purine pyrimidine amino keto H B V D Symbol N R All Complements cytidine thymidine anyBase pyrimidine weak strong amino keto H V D B AverageMass Complement pyrimidine MonoisotopicMass Name purine Represented by purine anyBase V D Represents adenosine guanidine purine Symbol R S All Complements guanidine cytidine strong pyrimidine purine amino keto H V D B AverageMass Complement weak MonoisotopicMass Name strong Represented by strong anyBase V B Represents cytidine guanidine weak Symbol S T All Complements adenosine anyBase weak purine amino H V D AverageMass 304.1964 Complement adenosine MonoisotopicMass 304.04604 Name thymidine Represented by thymidine anyBase weak pyrimidine keto H B D Represents thymidine Symbol T V All Complements guanidine cytidine thymidine weak strong pyrimidine purine amino keto H V D B AverageMass Complement B MonoisotopicMass Name V Represented by V anyBase Represents cytidine adenosine guanidine amino purine strong V Symbol V W All Complements adenosine thymidine anyBase weak pyrimidine purine amino keto H V D B AverageMass Complement strong MonoisotopicMass Name weak Represented by weak anyBase D H Represents adenosine thymidine weak Symbol W Y All Complements adenosine guanidine anyBase purine weak strong amino keto H V D B AverageMass Complement purine MonoisotopicMass Name pyrimidine Represented by pyrimidine anyBase H B Represents thymidine cytidine pyrimidine Symbol Y biococoa-2.2.2/BCFoundation/BCSequenceIO/BCCachedFastaFile.h000644 000765 000024 00000003327 11223237412 023763 0ustar00scottcstaff000000 000000 // // BCCachedFastaFile.h // BioCocoa // // Created by Scott Christley on 9/10/07. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import #import "BCCachedSequenceFile.h" @interface BCCachedFastaFile : BCCachedSequenceFile { } - initWithContentsOfFile:(NSString *)filePath; @end biococoa-2.2.2/BCFoundation/BCSequenceIO/BCCachedFastaFile.m000644 000765 000024 00000015736 11223237412 023777 0ustar00scottcstaff000000 000000 // // BCCachedFastaFile.m // BioCocoa // // Created by Scott Christley on 9/10/07. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCCachedFastaFile.h" #import "BCSymbolSet.h" #include @implementation BCCachedFastaFile - initWithContentsOfFile:(NSString *)filePath { [super initWithContentsOfFile: filePath]; // read file and get sequence meta-data FILE *g1 = fopen([filePath UTF8String], "r"); if (!g1) { NSLog(@"Could not open file: %@\n", filePath); [self dealloc]; return nil; } int seqNumber = 0; int seqLen = 0; int lineLen = 0; BOOL needLineLen = YES; NSMutableDictionary *d = nil; unsigned long long filePos; char c; while (!feof(g1)) { fread(&c, sizeof(char), 1, g1); if (feof(g1)) break; if (c == '>') { // fasta header // save length and end position of if (d) { [d setObject: [NSNumber numberWithInt: seqLen] forKey: @"length"]; [d setObject: [NSNumber numberWithInt: lineLen] forKey: @"line length"]; [d setObject: [NSNumber numberWithUnsignedLongLong: (filePos - 1)] forKey: @"end"]; } d = [NSMutableDictionary dictionary]; NSMutableString *fastaHeader = [NSMutableString string]; fread(&c, sizeof(char), 1, g1); while (c != '\n') { [fastaHeader appendFormat: @"%c", c]; fread(&c, sizeof(char), 1, g1); } [d setObject: fastaHeader forKey: @"id"]; [d setObject: [NSNumber numberWithInt: seqNumber] forKey: @"number"]; filePos = (unsigned long long)ftello(g1); [d setObject: [NSNumber numberWithUnsignedLongLong: filePos] forKey: @"start"]; [sequenceInfo setObject: d forKey: fastaHeader]; [sequenceList addObject: d]; seqLen = 0; lineLen = 0; needLineLen = YES; ++seqNumber; } else { // sequence data while ((c != '\n') && (!feof(g1))) { ++seqLen; if (needLineLen) ++lineLen; filePos = (unsigned long long)ftello(g1); fread(&c, sizeof(char), 1, g1); } needLineLen = NO; } } [d setObject: [NSNumber numberWithInt: seqLen] forKey: @"length"]; [d setObject: [NSNumber numberWithInt: lineLen] forKey: @"line length"]; [d setObject: [NSNumber numberWithUnsignedLongLong: (filePos - 1)] forKey: @"end"]; fclose(g1); //NSLog(@"%@\n", [sequenceInfo description]); //NSLog(@"sequences %d\n", [sequenceList count]); return self; } - (int)symbols:(char *)aBuffer ForCurrentSequenceAtPosition:(unsigned long long)aPos ofLength:(unsigned)aLen { int result = 0; BOOL doForward = YES; long seqLen = [[currentSequence objectForKey: @"length"] longValue]; long lineLen = [[currentSequence objectForKey: @"line length"] longValue]; unsigned long newPos; if (aPos < seqLen) { // forward strand newPos = aPos; if ((aPos + aLen) > seqLen) { NSLog(@"Attempting to read past end of forward stand: (%lu)\n", aPos); return 0; } } else { // reverse strand newPos = 2*seqLen - aPos - aLen; if (newPos < 0) { NSLog(@"Attempting to read past end of reverse strand: (%lu)\n", aPos); return 0; } doForward = NO; } int theLine = newPos / lineLen; int thePos = newPos % lineLen; int offset = theLine * (lineLen + 1) + thePos; unsigned long long filePos = [[currentSequence objectForKey: @"start"] unsignedLongLongValue]; //fsetpos(fileHandle, &filePos); fseeko(fileHandle, filePos, SEEK_SET); fseek(fileHandle, offset, SEEK_CUR); char c; while (result < aLen) { fread(&c, sizeof(char), 1, fileHandle); if (feof(fileHandle)) break; // skip invalid symbols if ([[BCSymbolSet dnaSymbolSet] symbolForChar: c]) { if (doForward) { // reading forward strand aBuffer[result] = c; ++result; } else { // reading reverse strand // reverse complement switch (c) { case 'a': c = 't'; break; case 't': c = 'a'; break; case 'c': c = 'g'; break; case 'g': c = 'c'; break; case 'A': c = 'T'; break; case 'T': c = 'A'; break; case 'C': c = 'G'; break; case 'G': c = 'C'; break; default: break; } aBuffer[aLen - result - 1] = c; ++result; } } } return result; } - (int)symbols:(char *)aBuffer atPosition:(unsigned long long)aPos ofLength:(unsigned)aLen forSequence:(NSString *)seqID { if (!fileHandle) { fileHandle = fopen([sequenceFile UTF8String], "r"); if (!fileHandle) { NSLog(@"Could not open file: %@\n", sequenceFile); return 0; } } NSDictionary *d = [sequenceInfo objectForKey: seqID]; if (!d) { NSLog(@"Unknown sequence: %@\n", seqID); return 0; } currentSequenceNumber = [[d objectForKey: @"number"] intValue]; currentSequence = d; return [self symbols: aBuffer ForCurrentSequenceAtPosition: aPos ofLength: aLen]; } - (int)symbols:(char *)aBuffer atPosition:(unsigned long long)aPos ofLength:(unsigned)aLen forSequenceNumber:(int)seqNum { if (currentSequenceNumber == seqNum) return [self symbols: aBuffer ForCurrentSequenceAtPosition: aPos ofLength: aLen]; if (!fileHandle) { fileHandle = fopen([sequenceFile UTF8String], "r"); if (!fileHandle) { NSLog(@"Could not open file: %@\n", sequenceFile); return 0; } } NSDictionary *d = [sequenceList objectAtIndex: seqNum]; if (!d) { NSLog(@"Unknown sequence number: %d\n", seqNum); return 0; } currentSequenceNumber = seqNum; currentSequence = d; return [self symbols: aBuffer ForCurrentSequenceAtPosition: aPos ofLength: aLen]; } @end biococoa-2.2.2/BCFoundation/BCSequenceIO/BCCachedSequenceFile.h000644 000765 000024 00000005503 11223237412 024473 0ustar00scottcstaff000000 000000 // // BCCachedSequenceFile.h // BioCocoa // // Created by Scott Christley on 9/10/07. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import // // Cached sequences // // For handling very large sequence files, // we do not want to read in all of sequence // data into memory; instead we parse the file // and pull out meta-data. Working with the // sequence data is handled by a specific cached // sequence class which reads data from the file // when needed. // @interface BCCachedSequenceFile : NSObject { NSString *sequenceFile; NSMutableDictionary *sequenceInfo; NSMutableArray *sequenceList; FILE *fileHandle; int currentSequenceNumber; NSDictionary *currentSequence; } + readCachedFileUsingPath:(NSString *)filePath; // overridden by file format specific subclasses - initWithContentsOfFile:(NSString *)filePath; - (unsigned)numberOfSequences; - (NSDictionary *)infoForSequence:(NSString *)seqID; - (NSDictionary *)infoForSequenceNumber:(int)seqNum; - (char)symbolAtPosition:(unsigned long long)aPos forSequence:(NSString *)seqID; - (char)symbolAtPosition:(unsigned long long)aPos forSequenceNumber:(int)seqNum; - (int)symbols:(char *)aBuffer atPosition:(unsigned long long)aPos ofLength:(unsigned)aLen forSequenceNumber:(int)seqNum; - (int)symbols:(char *)aBuffer atPosition:(unsigned long long)aPos ofLength:(unsigned)aLen forSequence:(NSString *)seqID; - (void)closeFileHandle; @end biococoa-2.2.2/BCFoundation/BCSequenceIO/BCCachedSequenceFile.m000644 000765 000024 00000007531 11223237412 024503 0ustar00scottcstaff000000 000000 // // BCCachedSequenceFile.m // BioCocoa // // Created by Scott Christley on 9/10/07. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCCachedSequenceFile.h" #import "BCCachedFastaFile.h" @implementation BCCachedSequenceFile + readCachedFileUsingPath:(NSString *)filePath { id result = nil; NSFileHandle *seqFile = [NSFileHandle fileHandleForReadingAtPath: filePath]; if (!seqFile) { NSLog(@"Could not open file: %@\n", filePath); return nil; } // determine file type by reading some data NSData *someData = [seqFile readDataOfLength: 10000]; NSString *entryString = [[NSString alloc] initWithData: someData encoding: NSASCIIStringEncoding]; // or NSUTF8StringEncoding ? [seqFile closeFile]; // TODO: currently only handle FASTA if ([entryString hasPrefix:@">"]) { result = [[BCCachedFastaFile alloc] initWithContentsOfFile: filePath]; } else { NSLog(@"Unsupported cached sequence file type.\n"); return nil; } return result; } - initWithContentsOfFile:(NSString *)filePath { [super init]; sequenceFile = filePath; fileHandle = NULL; sequenceInfo = [NSMutableDictionary new]; sequenceList = [NSMutableArray new]; currentSequenceNumber = -1; currentSequence = nil; return self; } - (void)dealloc { if (fileHandle) fclose(fileHandle); if (sequenceInfo) [sequenceInfo release]; if (sequenceList) [sequenceList release]; [super dealloc]; } - (unsigned)numberOfSequences { return [sequenceList count]; } - (NSDictionary *)infoForSequence:(NSString *)seqID { return [sequenceInfo objectForKey: seqID]; } - (NSDictionary *)infoForSequenceNumber:(int)seqNum { return [sequenceList objectAtIndex: seqNum]; } - (char)symbolAtPosition:(unsigned long long)aPos forSequence:(NSString *)seqID { char c = 0; [self symbols: &c atPosition: aPos ofLength: 1 forSequence: seqID]; return c; } - (char)symbolAtPosition:(unsigned long long)aPos forSequenceNumber:(int)seqNum { char c = 0; [self symbols: &c atPosition: aPos ofLength: 1 forSequenceNumber: seqNum]; return c; } - (int)symbols:(char *)aBuffer atPosition:(unsigned long long)aPos ofLength:(unsigned)aLen forSequenceNumber:(int)seqNum { return 0; } - (int)symbols:(char *)aBuffer atPosition:(unsigned long long)aPos ofLength:(unsigned)aLen forSequence:(NSString *)seqID { return 0; } - (void)closeFileHandle { if (fileHandle) fclose(fileHandle); fileHandle = NULL; currentSequenceNumber = -1; currentSequence = nil; } @end biococoa-2.2.2/BCFoundation/BCSequenceIO/BCCreator.h000644 000765 000024 00000006430 10404057133 022432 0ustar00scottcstaff000000 000000 /* BCCreator */ #import @interface BCCreator : NSObject { IBOutlet id formatPopup; IBOutlet id formatPopupView; NSString *lineBreak; } - (void)saveFile:matrix withComments:comments extraBlocks:eb; /* This method will bring up a save dialog in which the user can select the format he wants to use to save the data. Once a file format is chosen, this method invokes the corresponding method below to actually save the file. */ - (NSString *)createNexusFile:(NSDictionary *)matrix withComments:(NSString *)comments extraBlocks:(NSString *)eb; /* Returns an NSString containing a Nexus file. Matrix is an NSDictionary with the items as keys and all characters (without spaces) as values. Comments and extraBlocks are two optional parameters. Comments specifies the Nexus file comments this method should add to the Nexus file. With extraBlocks, one can add its own Nexus file blocks as an NSString. */ - (NSString *)createNexusFile:(NSDictionary *)matrix; // Invokes the createNexusFile:withComments:extraBlocks: method, using nil for both the comments and eb arguments. - (NSString *)createPirFile:(NSDictionary *)matrix; // Returns an NSString containing a Pir file. Matrix is an NSDictionary with the items as keys and all characters (without spaces) as values. - (NSString *)createFastaFile:(NSDictionary *)matrix; // Returns an NSString containing a Fasta file. Matrix is an NSDictionary with the items as keys and all characters (without spaces) as values. - (NSString *)createPhylipFile:(NSDictionary *)matrix; // Returns an NSString containing a Phylip file. Matrix is an NSDictionary with the items as keys and all characters (without spaces) as values. item names are automatically trimmed to 10 characters since Phylip can't handle longer item names - (NSString *)createClustalFile:(NSDictionary *)matrix; // Returns an NSString containing a Clustal file. Matrix is an NSDictionary with the items as keys and all characters (without spaces) as values. The sequences are automatically interleaved in rows of 100. - (NSString *)createGDEFile:(NSDictionary *)matrix; // Returns an NSString containing a GDE file. Matrix is an NSDictionary with the items as keys and all characters (without spaces) as values. - (NSString *)createMSFFile:(NSDictionary *)matrix; // Returns an NSString containing an MSF file. Matrix is an NSDictionary with the items as keys and all characters (without spaces) as values. - (NSString *)createSwissProtFile:(NSDictionary *)matrix; // Method that creates a SwissProt file NSString - (void)useUnixLineBreak; - (void)useWindowsLineBreak; - (void)useLineBreakFromSource:(NSDictionary *)matrix; /* These methods ensure cross-platform compatibility by offering the possbility to set the preferred line break. The default is set to Mac line breaks. If you want exported files to have DOS line breaks, call the useDOSLineBreak method before saving the file. Or use the useUnixLineBreak method for Unix. If you want to use the line break used in the source file the matrix was written from, call useLineBreakFromSource passing it the matrix as the only argument. All three methods call the setLineBreak method. */ - (NSString *) lineBreak; // Returns the line break that is currently in use. - (void) setLineBreak: (NSString *) aLineBreak; -(int)GCGCheckSum:(NSString *)seq; @end biococoa-2.2.2/BCFoundation/BCSequenceIO/BCCreator.m000644 000765 000024 00000026513 10404057133 022443 0ustar00scottcstaff000000 000000 #import "BCCreator.h" #import "../BCUtils/BCUtilStrings.h" @implementation BCCreator - (void)saveFile:matrix withComments:comments extraBlocks:eb { int runResult; NSSavePanel *sp; NSString *fileString, *fileFormat, *fileType; [NSBundle loadNibNamed:@"View" owner:self]; sp = [NSSavePanel savePanel]; [sp setAccessoryView:formatPopupView]; runResult = [sp runModalForDirectory:[@"~/" stringByExpandingTildeInPath] file:@"Untitled"]; if (runResult == NSOKButton) { fileFormat = [formatPopup titleOfSelectedItem]; if ([fileFormat isEqualTo:@"Nexus"]) { fileString = [self createNexusFile:matrix withComments:comments extraBlocks:eb]; fileType = @"nex"; } else if ([fileFormat isEqualTo:@"Clustal"]) { fileString = [self createClustalFile:matrix]; fileType = @"aln"; } else if ([fileFormat isEqualTo:@"GCG-MSF"]) { fileString = [self createMSFFile:matrix]; fileType = @"msf"; } else if ([fileFormat isEqualTo:@"PIR"]) { fileString = [self createPirFile:matrix]; fileType = @"pir"; } else if ([fileFormat isEqualTo:@"GDE"]) { fileString = [self createGDEFile:matrix]; fileType = @"gde"; } else if ([fileFormat isEqualTo:@"Fasta"]) { fileString = [self createFastaFile:matrix]; fileType = @"fst"; } else if ([fileFormat isEqualTo:@"SwissProt"]) { fileString = [self createSwissProtFile:matrix]; fileType = @"fst"; } else { fileString = [self createPhylipFile:matrix]; fileType = @"phy"; } if (![fileString writeToFile:[NSString stringWithFormat:@"%@.%@",[sp filename],fileType] atomically:YES]) NSBeep(); } } //Method that creates a Nexus file NSString - (NSString *)createNexusFile:(NSDictionary *)matrix withComments:(NSString *)comments extraBlocks:(NSString *)eb { int i; NSString *exportString; if (comments) { exportString = [NSString stringWithFormat:@"#NEXUS%@[!Nexus file created with the cocoaNexus framework. %@]%@%@BEGIN DATA;%@DIMENSIONS NTAX=%d NCHAR=%d;%@FORMAT DATATYPE=DNA MISSING=? GAP=- MATCHCHAR=. ;%@%@MATRIX%@%@", lineBreak, comments, lineBreak, lineBreak, lineBreak, [[matrix allKeys] count], [(NSString *)[matrix objectForKey:[[matrix allKeys]objectAtIndex:1]]length], lineBreak, lineBreak, lineBreak, lineBreak, lineBreak]; } else { exportString = [NSString stringWithFormat:@"#NEXUS%@[!Nexus file created with the cocoaNexus framework.]%@%@BEGIN DATA;%@DIMENSIONS NTAX=%d NCHAR=%d;%@FORMAT DATATYPE=DNA MISSING=? GAP=- MATCHCHAR=. ;%@%@MATRIX%@%@", lineBreak, lineBreak, lineBreak, lineBreak, [[matrix allKeys] count], [(NSString *)[matrix objectForKey:[[matrix allKeys]objectAtIndex:1]]length], lineBreak, lineBreak, lineBreak, lineBreak, lineBreak]; } for (i = 0; i < [[matrix allKeys] count]; i++) { exportString = [exportString stringByAppendingString:[NSString stringWithFormat:@"%@ %@%@%@", [[[matrix allKeys] objectAtIndex:i]stringByReplacingSpaceWithUnderscore], [matrix objectForKey:[[matrix allKeys]objectAtIndex:i]], lineBreak, lineBreak ]]; } exportString = [exportString stringByAppendingString:[NSString stringWithFormat:@"%@;%@END;%@%@", lineBreak, lineBreak, lineBreak, lineBreak]]; if (eb) { exportString = [exportString stringByAppendingString:[NSString stringWithFormat:@"%@%@", eb, lineBreak]]; } return exportString; } //Method that creates a Nexus file NSString - (NSString *)createNexusFile:(NSDictionary *)matrix { return [self createNexusFile:matrix withComments:nil extraBlocks:nil]; } //Method that creates a Fasta file NSString - (NSString *)createFastaFile:(NSDictionary *)matrix { int i; NSString *exportString; exportString = @""; for (i = 0; i < [[matrix allKeys] count]; i++) { exportString = [exportString stringByAppendingString:[NSString stringWithFormat:@">%@%@%@%@", [[matrix allKeys] objectAtIndex:i], lineBreak, [matrix objectForKey:[[matrix allKeys]objectAtIndex:i]], lineBreak ]]; } return exportString; } //Method that creates a Phylip file NSString - (NSString *)createPhylipFile:(NSDictionary *)matrix { int i; NSString *exportString, *itemName; exportString = [NSString stringWithFormat:@"%d %d%@", [[matrix allKeys] count], [(NSString *)[matrix objectForKey:[[matrix allKeys]objectAtIndex:1]]length], lineBreak]; for (i = 0; i < [[matrix allKeys] count]; i++) { itemName = [[matrix allKeys] objectAtIndex:i]; if ([itemName length] > 10) { itemName = [itemName substringToIndex:10]; } exportString = [exportString stringByAppendingString:[NSString stringWithFormat:@"%@ %@%@%@", itemName, [matrix objectForKey:[[matrix allKeys]objectAtIndex:i]], lineBreak, lineBreak ]]; } return exportString; } //Method that creates a PIR file NSString - (NSString *)createPirFile:(NSDictionary *)matrix { int i; NSString *exportString; exportString = @""; for (i = 0; i < [[matrix allKeys] count]; i++) { exportString = [exportString stringByAppendingString:[NSString stringWithFormat:@">DL; %@%@%@%@%@*%@", [[matrix allKeys] objectAtIndex:i], lineBreak, [[matrix allKeys] objectAtIndex:i], lineBreak, [matrix objectForKey:[[matrix allKeys]objectAtIndex:i]], lineBreak]]; } return exportString; } //Method that creates a Clustal file NSString - (NSString *)createClustalFile:(NSDictionary *)matrix { int i, j, numberOfChars; NSString *exportString; exportString = [NSString stringWithFormat:@"CLUSTAL X (1.81) multiple sequence alignment%@%@%@", lineBreak, lineBreak, lineBreak]; numberOfChars = [(NSString *)[matrix objectForKey:[[matrix allKeys]objectAtIndex:1]]length]; for (j = 0; j < numberOfChars; j=j+100) { for (i = 0; i < [[matrix allKeys] count]; i++) { if (j+100 < numberOfChars) { exportString = [exportString stringByAppendingString:[NSString stringWithFormat:@"%@ %@%@", [[matrix allKeys] objectAtIndex:i], [[matrix objectForKey:[[matrix allKeys]objectAtIndex:i]]substringWithRange:NSMakeRange(j, 100)], lineBreak ]]; } else { exportString = [exportString stringByAppendingString:[NSString stringWithFormat:@"%@ %@%@", [[matrix allKeys] objectAtIndex:i], [[matrix objectForKey:[[matrix allKeys]objectAtIndex:i]]substringWithRange:NSMakeRange(j, numberOfChars-j)], lineBreak ]]; } } exportString = [exportString stringByAppendingString:lineBreak]; } exportString = [exportString stringByAppendingString:lineBreak]; return exportString; } //Method that creates a MSF file NSString - (NSString *)createMSFFile:(NSDictionary *)matrix { int i, j, numberOfChars, totalCheckSum; NSString *exportString; NSMutableString *sequence; numberOfChars = [(NSString *)[matrix objectForKey:[[matrix allKeys]objectAtIndex:1]]length]; //Calculate the total checksum totalCheckSum = 0; for (i = 0; i < [[matrix allKeys] count]; i++) { sequence = [matrix objectForKey:[[matrix allKeys]objectAtIndex:i]]; [sequence replaceOccurrencesOfString:@"-" withString:@"." options:NULL range:NSMakeRange(0, [sequence length])]; totalCheckSum = totalCheckSum + (int)[self GCGCheckSum:sequence]; } totalCheckSum = totalCheckSum % 10000; //Create the header with the total cheksum and length exportString = [NSString stringWithFormat:@"PileUp%@%@%@%@MSF: %d Type: N Check: %d ..%@%@", lineBreak, lineBreak, lineBreak, lineBreak, numberOfChars, totalCheckSum, lineBreak, lineBreak]; //Add a line for every item with length and checksum for (i = 0; i < [[matrix allKeys] count]; i++) { sequence = [matrix objectForKey:[[matrix allKeys]objectAtIndex:i]]; exportString = [exportString stringByAppendingString:[NSString stringWithFormat:@"Name: %@ oo Len: %d Check: %d Weight: 100.0%@", [[matrix allKeys] objectAtIndex:i], [sequence length], [self GCGCheckSum:sequence], lineBreak ]]; } //Add the // exportString = [exportString stringByAppendingString:[NSString stringWithFormat:@"%@//%@%@%@%@", lineBreak, lineBreak, lineBreak, lineBreak, lineBreak]]; for (j = 0; j < numberOfChars; j=j+100) { for (i = 0; i < [[matrix allKeys] count]; i++) { if (j+100 < numberOfChars) { exportString = [exportString stringByAppendingString:[NSString stringWithFormat:@"%@ %@%@", [[matrix allKeys] objectAtIndex:i], [[matrix objectForKey:[[matrix allKeys]objectAtIndex:i]]substringWithRange:NSMakeRange(j, 100)], lineBreak ]]; } else { exportString = [exportString stringByAppendingString:[NSString stringWithFormat:@"%@ %@%@", [[matrix allKeys] objectAtIndex:i], [[matrix objectForKey:[[matrix allKeys]objectAtIndex:i]]substringWithRange:NSMakeRange(j, numberOfChars-j)], lineBreak ]]; } } exportString = [exportString stringByAppendingString:lineBreak]; } exportString = [exportString stringByAppendingString:lineBreak]; return exportString; } //Method that creates a SwissProt file NSString - (NSString *)createSwissProtFile:(NSDictionary *)matrix { int i; NSString *exportString; exportString = @""; for (i = 0; i < [[matrix allKeys] count]; i++) { // exportString = [exportString stringByAppendingString:[NSString stringWithFormat:@"#%@%@%@%@", // [[matrix allKeys] objectAtIndex:i], lineBreak, // [matrix objectForKey:[[matrix allKeys]objectAtIndex:i]], lineBreak ]]; } return exportString; } //Method that creates a GDE file NSString - (NSString *)createGDEFile:(NSDictionary *)matrix { int i; NSString *exportString; exportString = @""; for (i = 0; i < [[matrix allKeys] count]; i++) { exportString = [exportString stringByAppendingString:[NSString stringWithFormat:@"#%@%@%@%@", [[matrix allKeys] objectAtIndex:i], lineBreak, [matrix objectForKey:[[matrix allKeys]objectAtIndex:i]], lineBreak ]]; } return exportString; } -(int)GCGCheckSum:(NSString *)seq { const char *sequence = [seq lossyCString]; long i, check, count; int len, val; check = count = 0; len = [seq length]; for(i = 0; i < len; i++) { val = sequence[i]; if((val == -3) || (val == 253)) break; count++; check += count * toupper((int) sequence[i]); if(count == 57) { count = 0; } } check %= 10000; return check; } - (void)useLineBreakFromSource:(NSDictionary *)matrix { if ([matrix objectForKey:@"lineBreak"]) { [self setLineBreak:[matrix objectForKey:@"lineBreak"]]; } } - (void)useUnixLineBreak { [self setLineBreak:@"\n"]; } - (void)useWindowsLineBreak { [self setLineBreak:@"\r\n"]; } //Accessors for the line break - (NSString *) lineBreak { return lineBreak; } - (void) setLineBreak: (NSString *) aLineBreak { if (lineBreak != aLineBreak) { [aLineBreak retain]; [lineBreak release]; lineBreak = aLineBreak; } } // Memory management - (id)init { if (self = [super init]) { [self setLineBreak:@"\r"]; } return self; } - (void)dealloc { [lineBreak release]; [super dealloc]; } @end biococoa-2.2.2/BCFoundation/BCSequenceIO/BCReader.h000644 000765 000024 00000014346 11070521237 022243 0ustar00scottcstaff000000 000000 /* BCReader */ #import @interface BCReader : NSObject { } - (NSDictionary *)readFile:(NSString *)textFile; /* This method automatically detects the file format and passes the NSString containing the contents of the textfile to the appropriate method. In most cases, this method will be the only one in this class that will be used directly. For an overview of the contents of the NSDictionary returned by this method, see the Overview section in the readNexusFile method comment. */ - (NSDictionary *)readNexusFile:(NSString *)textFile; /* This method reads a Nexus file. You need to pass it the entire Nexus file as a NSString and it will return a root NSDictionary that contains several objects. The most important of these is matrixDictionary, another NSDictionary with the item names as keys and the characters (sequence) in an NSString as the value object. Additionally, the root NSDictionary also contains a 'comments' key that returns the Nexus file's main comment, and a 'items' key that returns an array of items in the Nexus file. Overview: This method returns a root NSDictionary containing the following Keys and Objects: - Key: matrix Value: NSDictionary with item names as keys and characters as values - Key: comments Value: NSString containing the Nexus file's main comment - Key: items Value: NSArray containing all item names - Key: trees Value: NSArray containing all tree descriptions as Newick strings - Key: lineBreak Value: NSString containing the line break used in textFile - Key: fileType Value: NSString containing the fileType */ - (NSDictionary *)readNexusFileAndBlocks:(NSString *)textFile; /* This method invokes the readNexusFile file method but it additionally returns an extra key in the root NSDictionary (see overview). The extra key is called blocks and it points to an NSDictionary holding all Nexus blocks. The names of the blocks are used as the keys in this blocks dictionary. Overview: This method returns a root NSDictionary containing the following Keys and Objects: - Key: matrix Value: NSDictionary with item names as keys and characters as values - Key: comments Value: NSString containing the Nexus file's main comment - Key: items Value: NSArray containing all item names - Key: trees Value: NSArray containing all tree descriptions as Newick strings - Key: lineBreak Value: NSString containing the line break used in textFile - Key: blocks Value: NSDictionary with Nexus block names as keys and their contents as values */ - (NSDictionary *)readPhylipFile:(NSString *)textFile; /* This method returns a similar NSDictionary as with the readNexusFile method (see Overview). There is one difference: the comments key is not present since this file format does not support comments. */ - (NSDictionary *)readPirFile:(NSString *)textFile; /* This method returns a similar NSDictionary as with the readNexusFile method (see Overview). There is one difference: the comments key is not present since this file format does not support comments. */ - (NSDictionary *)readFastaFile:(NSString *)textFile; /* This method returns a similar NSDictionary as with the readNexusFile method (see Overview). There is one difference: the comments key is not present since this file format does not support comments. */ - (NSDictionary *)readGDEFile:(NSString *)textFile; /* This method returns a similar NSDictionary as with the readNexusFile method (see Overview). There is one difference: the comments key is not present since this file format does not support comments. */ - (NSDictionary *)readClustalFile:(NSString *)textFile; /* This method returns a similar NSDictionary as with the readNexusFile method (see Overview). There is one difference: the comments key is not present since this file format does not support comments. */ - (NSDictionary *)readMSFFile:(NSString *)textFile; /* This method returns a similar NSDictionary as with the readNexusFile method (see Overview). There is one difference: the comments key is not present since this file format does not support comments. */ - (NSDictionary *)readSwissProtFile:(NSString *)textFile; /* This method reads a SwissProt or EMBL file. You need to pass it the entire SwissProt or EMBL file as a NSString and it will return a root NSDictionary that contains several objects. Overview: This method returns a root NSDictionary containing the following Keys and Objects: - Key: matrix Value: NSDictionary with the ID-field as key and the sequence as value - Key: comments Value: NSString containing the file's description - Key: organism Value: NSString containing the file's organism - Key: items Value: NSArray containing all item names - Key: lineBreak Value: NSString containing the line break used in textFile - Key: fileType Value: NSString containing the fileType */ - (NSDictionary *)readPDBFile:(NSString *)textFile; /* This method reads a PDB file. You need to pass it the entire PDB file as a NSString and it will return a root NSDictionary that contains several objects. Overview: This method returns a root NSDictionary containing the following Keys and Objects: - Key: matrix Value: NSDictionary with the header as key and the sequence as value - Key: comments Value: NSString containing the file's title - Key: organism Value: NSString containing the file's source - Key: items Value: NSArray containing all item names - Key: lineBreak Value: NSString containing the line break used in textFile - Key: fileType Value: NSString containing the fileType */ - (NSDictionary *)readNCBIFile:(NSString *)textFile; /* This method reads a NCBI file. You need to pass it the entire NCBI file as a NSString and it will return a root NSDictionary that contains several objects. Overview: This method returns a root NSDictionary containing the following Keys and Objects: - Key: matrix Value: NSDictionary with the locus as key and sequence as value - Key: comments Value: NSString containing the file's definition - Key: organism Value: NSString containing the file's organism - Key: items Value: NSArray containing all item names - Key: lineBreak Value: NSString containing the line break used in textFile - Key: fileType Value: NSString containing the fileType */ - (NSMutableString *)convertLineBreaksToMac:(NSString *)textFile; - (NSString *)detectLineBreak:(NSString *)srcNStr; @end biococoa-2.2.2/BCFoundation/BCSequenceIO/BCReader.m000644 000765 000024 00000077732 11070521237 022260 0ustar00scottcstaff000000 000000 #import "BCReader.h" #import "../BCUtils/BCUtilStrings.h" @implementation BCReader - (NSDictionary *)readFile:(NSString *)textFile { NSMutableDictionary *theContents; NSString *lineBreak; lineBreak = [self detectLineBreak:textFile]; if ([textFile hasCaseInsensitivePrefix:@"#NEXUS"] || [textFile hasCaseInsensitivePrefix:@"#PAUP"]) { theContents = (NSMutableDictionary*) [self readNexusFileAndBlocks:textFile]; } else if ([textFile hasCaseInsensitivePrefix:@"CLUSTAL"]) { theContents = (NSMutableDictionary*) [self readClustalFile:textFile]; } else if ([textFile hasCaseInsensitivePrefix:@"Pileup"]) { theContents = (NSMutableDictionary*) [self readMSFFile:textFile]; } else if ([textFile hasCaseInsensitivePrefix:@">DL"]) { theContents = (NSMutableDictionary*) [self readPirFile:textFile]; } else if ([textFile hasPrefix:@">"]) { theContents = (NSMutableDictionary*) [self readFastaFile:textFile]; } else if ([textFile hasPrefix:@"HEADER"]) { theContents = (NSMutableDictionary*) [self readPDBFile:textFile]; } else if ([textFile hasPrefix:@"LOCUS"]) { theContents = (NSMutableDictionary*) [self readNCBIFile:textFile]; } else if ([textFile hasPrefix:@"#"]) { theContents = (NSMutableDictionary*) [self readGDEFile:textFile]; } else if ([textFile hasPrefix:@"ID"]) // also works for EMBL files, both have the same prefix in the first line { theContents = (NSMutableDictionary*) [self readSwissProtFile:textFile]; } else if ([textFile stringBeginsWithTwoNumbers]) { theContents = (NSMutableDictionary*) [self readPhylipFile:textFile]; } else { return nil; // should we have a error message here? } [theContents setObject:lineBreak forKey:@"lineBreak"]; return theContents; } - (NSDictionary *)readPhylipFile:(NSString *)textFile { int i, j; NSScanner *itemScanner; NSString *stringWithMacLineBreaks; NSMutableString *item, *sequence, *tempSequence; NSMutableArray *linesArray; NSMutableDictionary *matrixDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *phylipDictionary = [NSMutableDictionary dictionary]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity:10]; j = 0; //Convert all line breaks to Mac line breaks (\r) stringWithMacLineBreaks = [self convertLineBreaksToMac:textFile]; //Isolate individual lines based on \r linesArray = (NSMutableArray*)[stringWithMacLineBreaks componentsSeparatedByString:@"\r"]; //Remove empty lines for (i = 0; i < [linesArray count]; i++) { if ([(NSString *)[linesArray objectAtIndex:i]length] < 1 || [[linesArray objectAtIndex:i] isEqualTo:@""]) { [linesArray removeObjectAtIndex:i]; i--; } } //Read item names and sequences and put them in the matrixDictionary. We can ignore the first line. for (i = 1; i < [linesArray count]; i++) { if ([[linesArray objectAtIndex:i] hasPrefix:@" "]) { //If the item name is not present sequence = [linesArray objectAtIndex:i]; tempSequence = (NSMutableString*)[[matrixDictionary objectForKey:[itemArray objectAtIndex:j]] stringByAppendingString:sequence]; [matrixDictionary setObject:tempSequence forKey:[itemArray objectAtIndex:j]]; j++; if (j == [itemArray count]) { j = 0;} } else { //If the item name precedes the sequence itemScanner = [[NSScanner alloc] initWithString:[linesArray objectAtIndex:i]]; [itemScanner scanUpToString:@" " intoString:&item]; sequence = (NSMutableString*)[[linesArray objectAtIndex:i]substringFromIndex:[itemScanner scanLocation]]; [matrixDictionary setObject:sequence forKey:item]; [itemArray addObject:item]; //NSLog(@"Adding item %@", item); [itemScanner release]; } } //Remove spaces and tabs from the sequences in the matrixDictionary for (i = 0; i < [itemArray count]; i++) { tempSequence = [NSMutableString stringWithString:[matrixDictionary objectForKey:[itemArray objectAtIndex:i]]]; [tempSequence replaceOccurrencesOfString:@" " withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [tempSequence replaceOccurrencesOfString:@"\t" withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [matrixDictionary setObject:tempSequence forKey:[itemArray objectAtIndex:i]]; } //Put the matrixDictionary and the items Array in the phylipDictionary [phylipDictionary setObject:matrixDictionary forKey:@"matrix"]; [phylipDictionary setObject:itemArray forKey:@"items"]; [phylipDictionary setObject:@"phylip" forKey:@"fileType"]; return phylipDictionary; } - (NSDictionary *)readPirFile:(NSString *)textFile { int i; NSScanner *itemScanner; NSString *stringWithMacLineBreaks; NSMutableString *item, *sequence, *tempSequence; NSMutableArray *linesArray; NSMutableDictionary *matrixDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *pirDictionary = [NSMutableDictionary dictionary]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity:10]; //Convert all line breaks to Mac line breaks (\r) stringWithMacLineBreaks = [self convertLineBreaksToMac:textFile]; //Isolate individual lines based on >DL; linesArray = (NSMutableArray*)[textFile componentsSeparatedByString:@">DL;"]; //Trim lines from surrounding whitespaces and remove empty lines for (i = [linesArray count]-1; i >= 0 ; i--) { [linesArray insertObject:[[linesArray objectAtIndex:i]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] atIndex:i]; [linesArray removeObjectAtIndex:i+1]; if ([[linesArray objectAtIndex:i]isEqualTo:@""]) { [linesArray removeObjectAtIndex:i]; } } //Read item names and sequences and put them in the matrixDictionary for (i = 0; i < [linesArray count]; i++) { itemScanner = [[NSScanner alloc] initWithString:[linesArray objectAtIndex:i]]; [itemScanner scanUpToString:@"\r" intoString:&item]; [itemScanner scanUpToString:@"\r" intoString:NULL]; //there is an additional line of information containing a textual description before the sequence begins, not sure how to store with sequence sequence = (NSMutableString*)[[linesArray objectAtIndex:i]substringFromIndex:[itemScanner scanLocation]]; [matrixDictionary setObject:sequence forKey:item]; [itemArray addObject:item]; [itemScanner release]; } //Remove spaces, carriage returns and * from the sequences in the matrixDictionary for (i = 0; i < [itemArray count]; i++) { tempSequence = [NSMutableString stringWithString:[matrixDictionary objectForKey:[itemArray objectAtIndex:i]]]; [tempSequence replaceOccurrencesOfString:@" " withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [tempSequence replaceOccurrencesOfString:@"*" withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [tempSequence replaceOccurrencesOfString:@"\r" withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [matrixDictionary setObject:tempSequence forKey:[itemArray objectAtIndex:i]]; } //Put the matrixDictionary and the items Array in the fastaDictionary [pirDictionary setObject:matrixDictionary forKey:@"matrix"]; [pirDictionary setObject:itemArray forKey:@"items"]; [pirDictionary setObject:@"pir" forKey:@"fileType"]; return pirDictionary; } - (NSDictionary *)readFastaFile:(NSString *)textFile { int i; NSMutableArray *linesArray; NSMutableDictionary *matrixDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *fastaDictionary = [NSMutableDictionary dictionary]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity:10]; #if 0 NSMutableString *item, *sequence, *tempSequence; NSScanner *itemScanner; NSString *stringWithMacLineBreaks; //Convert all line breaks to Mac line breaks (\r) stringWithMacLineBreaks = [self convertLineBreaksToMac:textFile]; //Isolate individual lines based on > linesArray = (NSMutableArray*)[textFile componentsSeparatedByString:@">"]; //Trim lines from surrounding whitespaces and remove empty lines for (i = [linesArray count]; i = 0 ; i--) { if ([[linesArray objectAtIndex:i]isEqualTo:@""]) { [linesArray removeObjectAtIndex:i]; } [linesArray insertObject:[[linesArray objectAtIndex:i]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] atIndex:i]; [linesArray removeObjectAtIndex:i+1]; } //Read item names and sequences and put them in the matrixDictionary for (i = 1; i < [linesArray count]; i++) { itemScanner = [[NSScanner alloc] initWithString:[linesArray objectAtIndex:i]]; [itemScanner scanUpToString:@"\r" intoString:&item]; sequence = (NSMutableString*)[[linesArray objectAtIndex:i]substringFromIndex:[itemScanner scanLocation]]; [matrixDictionary setObject:sequence forKey:item]; [itemArray addObject:item]; [itemScanner release]; } //Remove spaces, carriage returns and tabs from the sequences in the matrixDictionary for (i = 0; i < [itemArray count]; i++) { tempSequence = [NSMutableString stringWithString:[matrixDictionary objectForKey:[itemArray objectAtIndex:i]]]; [tempSequence replaceOccurrencesOfString:@" " withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [tempSequence replaceOccurrencesOfString:@"\t" withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [tempSequence replaceOccurrencesOfString:@"\r" withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [matrixDictionary setObject:tempSequence forKey:[itemArray objectAtIndex:i]]; } #else NSString *line, *item, *sequence; linesArray = [textFile splitLines]; for (i = 0; i < [linesArray count]; i++) { line = [linesArray objectAtIndex: i]; if ([line hasPrefix: @">"] ) { item = [line substringFromIndex:1]; line = [linesArray objectAtIndex: ++i]; sequence = @""; while (![line hasPrefix:@">"] ) { sequence = [sequence stringByAppendingString:[line stringByRemovingWhitespace]]; i++; if ( i < [linesArray count]) line = [linesArray objectAtIndex: i]; else break; } [matrixDictionary setObject:sequence forKey:item]; [itemArray addObject: item]; i--; } } #endif //Put the matrixDictionary and the items Array in the fastaDictionary [fastaDictionary setObject:matrixDictionary forKey:@"matrix"]; [fastaDictionary setObject:itemArray forKey:@"items"]; [fastaDictionary setObject:@"fasta" forKey:@"fileType"]; return fastaDictionary; } - (NSDictionary *)readGDEFile:(NSString *)textFile { int i; NSScanner *itemScanner; NSString *stringWithMacLineBreaks; NSMutableString *item, *sequence, *tempSequence; NSMutableArray *linesArray; NSMutableDictionary *matrixDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *gdeDictionary = [NSMutableDictionary dictionary]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity:10]; //Convert all line breaks to Mac line breaks (\r) stringWithMacLineBreaks = [self convertLineBreaksToMac:textFile]; //Isolate individual lines based on # linesArray = (NSMutableArray*)[stringWithMacLineBreaks componentsSeparatedByString:@"#"]; //Trim lines from surrounding whitespaces and remove empty lines for (i = [linesArray count]; i = 0 ; i--) { if ([[linesArray objectAtIndex:i]isEqualTo:@""]) { [linesArray removeObjectAtIndex:i]; } [linesArray insertObject:[[linesArray objectAtIndex:i]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] atIndex:i]; [linesArray removeObjectAtIndex:i+1]; } //Read item names and sequences and put them in the matrixDictionary for (i = 1; i < [linesArray count]; i++) { itemScanner = [[NSScanner alloc] initWithString:[linesArray objectAtIndex:i]]; [itemScanner scanUpToString:@"\r" intoString:&item]; sequence = (NSMutableString*)[[linesArray objectAtIndex:i]substringFromIndex:[itemScanner scanLocation]]; [matrixDictionary setObject:sequence forKey:item]; [itemArray addObject:item]; [itemScanner release]; } //Remove spaces, carriage returns and tabs from the sequences in the matrixDictionary for (i = 0; i < [itemArray count]; i++) { tempSequence = [NSMutableString stringWithString:[matrixDictionary objectForKey:[itemArray objectAtIndex:i]]]; [tempSequence replaceOccurrencesOfString:@" " withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [tempSequence replaceOccurrencesOfString:@"\t" withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [tempSequence replaceOccurrencesOfString:@"\r" withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [matrixDictionary setObject:tempSequence forKey:[itemArray objectAtIndex:i]]; } //Put the matrixDictionary and the items Array in the fastaDictionary [gdeDictionary setObject:matrixDictionary forKey:@"matrix"]; [gdeDictionary setObject:itemArray forKey:@"items"]; [gdeDictionary setObject:@"gde" forKey:@"fileType"]; return gdeDictionary; } - (NSDictionary *)readClustalFile:(NSString *)textFile { int i; NSScanner *itemScanner; NSString *stringWithMacLineBreaks; NSMutableString *item, *sequence, *tempSequence; NSMutableArray *linesArray; NSMutableDictionary *matrixDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *clustalDictionary = [NSMutableDictionary dictionary]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity:10]; //Convert all line breaks to Mac line breaks (\r) stringWithMacLineBreaks = [self convertLineBreaksToMac:textFile]; //Isolate individual lines based on \r linesArray = (NSMutableArray *)[stringWithMacLineBreaks componentsSeparatedByString:@"\r"]; //Trim lines from surrounding whitespaces and remove empty lines for (i = 0; i < [linesArray count]; i++) { if ([[linesArray objectAtIndex:i]isEqualTo:@""] || [[linesArray objectAtIndex:i]hasPrefix:@" "]) { [linesArray removeObjectAtIndex:i]; i--; } [linesArray insertObject:[[linesArray objectAtIndex:i]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] atIndex:i]; [linesArray removeObjectAtIndex:i+1]; } //Read item names and sequences and put them in the matrixDictionary for (i = 1; i < [linesArray count]; i++) { itemScanner = [[NSScanner alloc] initWithString:[linesArray objectAtIndex:i]]; [itemScanner scanUpToString:@" " intoString:&item]; sequence = (NSMutableString*)[[linesArray objectAtIndex:i]substringFromIndex:[itemScanner scanLocation]]; if ([matrixDictionary objectForKey:item]) { //If the item already exists tempSequence = (NSMutableString*)[[matrixDictionary objectForKey:item] stringByAppendingString:sequence]; [matrixDictionary setObject:tempSequence forKey:item]; } else { //If the item does not yet exist [matrixDictionary setObject:sequence forKey:item]; [itemArray addObject:item]; } [itemScanner release]; } //Remove spaces and tabs from the sequences in the matrixDictionary //itemArray = [matrixDictionary allKeys]; for (i = 0; i < [itemArray count]; i++) { tempSequence = [NSMutableString stringWithString:[matrixDictionary objectForKey:[itemArray objectAtIndex:i]]]; [tempSequence replaceOccurrencesOfString:@" " withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [tempSequence replaceOccurrencesOfString:@"\t" withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [matrixDictionary setObject:tempSequence forKey:[itemArray objectAtIndex:i]]; } //Put the matrixDictionary and the items Array in the clustalDictionary [clustalDictionary setObject:matrixDictionary forKey:@"matrix"]; [clustalDictionary setObject:itemArray forKey:@"items"]; [clustalDictionary setObject:@"clustal" forKey:@"fileType"]; return clustalDictionary; } - (NSDictionary *)readMSFFile:(NSString *)textFile { int i; NSScanner *itemScanner; NSString *stringWithMacLineBreaks, *trimmedString; NSMutableString *item, *sequence, *tempSequence; NSMutableArray *linesArray; NSMutableDictionary *matrixDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *MSFDictionary = [NSMutableDictionary dictionary]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity:10]; //Convert all line breaks to Mac line breaks (\r) stringWithMacLineBreaks = [self convertLineBreaksToMac:textFile]; //Trim the first part of the string trimmedString = [[stringWithMacLineBreaks componentsSeparatedByString:@"//"]objectAtIndex:1]; //Isolate individual lines based on \r linesArray = (NSMutableArray *)[trimmedString componentsSeparatedByString:@"\r"]; //Trim lines from surrounding whitespaces and remove empty lines for (i = [linesArray count]-1; i >= 0 ; i--) { [linesArray insertObject:[[linesArray objectAtIndex:i]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] atIndex:i]; [linesArray removeObjectAtIndex:i+1]; if ([[linesArray objectAtIndex:i]isEqualTo:@""] || [[linesArray objectAtIndex:i]hasPrefix:@" "]) { [linesArray removeObjectAtIndex:i]; } } //Read item names and sequences and put them in the matrixDictionary for (i = 0; i < [linesArray count]; i++) { itemScanner = [[NSScanner alloc] initWithString:[linesArray objectAtIndex:i]]; [itemScanner scanUpToString:@" " intoString:&item]; sequence = (NSMutableString*)[[linesArray objectAtIndex:i]substringFromIndex:[itemScanner scanLocation]]; if ([matrixDictionary objectForKey:item]) { //If the item already exists tempSequence = (NSMutableString*)[[matrixDictionary objectForKey:item] stringByAppendingString:sequence]; [matrixDictionary setObject:tempSequence forKey:item]; } else { //If the item does not yet exist [matrixDictionary setObject:sequence forKey:item]; [itemArray addObject:item]; } [itemScanner release]; } //Remove spaces and tabs from the sequences in the matrixDictionary //itemArray = [matrixDictionary allKeys]; for (i = 0; i < [itemArray count]; i++) { tempSequence = [NSMutableString stringWithString:[matrixDictionary objectForKey:[itemArray objectAtIndex:i]]]; [tempSequence replaceOccurrencesOfString:@" " withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [tempSequence replaceOccurrencesOfString:@"\t" withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [matrixDictionary setObject:tempSequence forKey:[itemArray objectAtIndex:i]]; } //Put the matrixDictionary and the items Array in the clustalDictionary [MSFDictionary setObject:matrixDictionary forKey:@"matrix"]; [MSFDictionary setObject:itemArray forKey:@"items"]; [MSFDictionary setObject:@"msf" forKey:@"fileType"]; return MSFDictionary; } - (NSDictionary *)readNexusFile:(NSString *)textFile { int i; NSScanner *matrixScanner, *itemScanner, *commentScanner, *treeScanner; NSString *comments = @""; NSString *treeString = @""; NSString *stringWithMacLineBreaks; NSMutableString *item, *sequence, *tempSequence, *matrix, *bracketsString; NSMutableArray *linesArray, *bracketsArray; NSMutableDictionary *matrixDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *nexusDictionary = [NSMutableDictionary dictionary]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity:10]; NSMutableArray *treesArray = [NSMutableArray arrayWithCapacity:10]; //Extract the Nexus file's main comments commentScanner = [[NSScanner alloc] initWithString:textFile]; [commentScanner scanUpToString:@"[!" intoString:nil]; [commentScanner scanString:@"[!" intoString:nil]; [commentScanner scanUpToString:@"]" intoString:&comments]; [commentScanner release]; //Put the comments in the nexusDictionary if (![comments isEqualTo:@""]) { [nexusDictionary setObject:comments forKey:@"comments"]; } //Check whether a treeblock exists and extract it if ([textFile rangeOfString:@"begin trees;" options:NSCaseInsensitiveSearch||NSBackwardsSearch].length != 0) { treeScanner = [[NSScanner alloc] initWithString:textFile]; [treeScanner scanUpToString:@"begin trees;" intoString:nil]; [treeScanner scanString:@"begin trees;" intoString:nil]; [treeScanner scanUpToString:@"end;" intoString:&treeString]; [treeScanner release]; treesArray = [NSMutableArray arrayWithArray:[treeString componentsSeparatedByString:@";"]]; //Put the trees in the treesArray if ([treesArray count] > 0) { [treesArray removeObjectAtIndex:0]; [treesArray removeObjectAtIndex:[treesArray count]-1]; //NSLog(@"%@", treesArray); [nexusDictionary setObject:treesArray forKey:@"trees"]; } } //Remove other comments (in sequences) between the [] bracketsString = [NSMutableString stringWithString:textFile]; [bracketsString replaceOccurrencesOfString:@"[" withString:@"!!!*" options:NULL range:NSMakeRange(0, [bracketsString length])]; [bracketsString replaceOccurrencesOfString:@"]" withString:@"!!!" options:NULL range:NSMakeRange(0, [bracketsString length])]; bracketsArray = (NSMutableArray *)[bracketsString componentsSeparatedByString:@"!!!"]; for (i = 0; i < [bracketsArray count]; i++) { if ([[bracketsArray objectAtIndex:i]hasPrefix:@"*"]){ [bracketsArray removeObjectAtIndex:i]; } } matrix = (NSMutableString *)[bracketsArray componentsJoinedByString:@""]; //Isolate the matrix matrixScanner = [[NSScanner alloc] initWithString:matrix]; [matrixScanner scanUpToString:@"matrix" intoString:nil]; [matrixScanner scanUpToString:@";" intoString:&matrix]; [matrixScanner release]; //Convert all line breaks to Mac line breaks (\r) stringWithMacLineBreaks = [self convertLineBreaksToMac:matrix]; //Isolate individual lines based on \r linesArray = (NSMutableArray *)[stringWithMacLineBreaks componentsSeparatedByString:@"\r"]; //Trim lines from surrounding whitespaces and remove empty lines for (i = 0; i < [linesArray count]; i++) { [linesArray insertObject:[[linesArray objectAtIndex:i]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] atIndex:i]; [linesArray removeObjectAtIndex:i+1]; if ([[linesArray objectAtIndex:i]isEqualTo:@""]) { [linesArray removeObjectAtIndex:i]; i--; } } //Read item names and sequences and put them in the matrixDictionary for (i = 1; i < [linesArray count]; i++) { itemScanner = [[NSScanner alloc] initWithString:[linesArray objectAtIndex:i]]; [itemScanner scanUpToString:@" " intoString:&item]; sequence = (NSMutableString *)[[linesArray objectAtIndex:i]substringFromIndex:[itemScanner scanLocation]]; if ([matrixDictionary objectForKey:item]) { //If the item already exists tempSequence = [NSMutableString stringWithString:[[matrixDictionary objectForKey:item] stringByAppendingString:sequence]]; [matrixDictionary setObject:tempSequence forKey:item]; } else { //If the item does not yet exist [matrixDictionary setObject:sequence forKey:item]; [itemArray addObject:item]; //Put the item name in the itemArray } [itemScanner release]; } //Remove spaces and tabs from the sequences in the matrixDictionary for (i = 0; i < [itemArray count]; i++) { tempSequence = [NSMutableString stringWithString:[matrixDictionary objectForKey:[itemArray objectAtIndex:i]]]; [tempSequence replaceOccurrencesOfString:@" " withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [tempSequence replaceOccurrencesOfString:@"\t" withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [matrixDictionary setObject:tempSequence forKey:[itemArray objectAtIndex:i]]; } //Put the matrixDictionary and the items Array in the nexusDictionary [nexusDictionary setObject:matrixDictionary forKey:@"matrix"]; [nexusDictionary setObject:itemArray forKey:@"items"]; [nexusDictionary setObject:@"nexus" forKey:@"fileType"]; return nexusDictionary; } - (NSDictionary *)readNexusFileAndBlocks:(NSString *)textFile { int i; NSMutableDictionary *dict; NSScanner *scanner; NSArray *blocksArray; NSString *blockName, *blockContents; NSMutableDictionary *blocksDictionary = [NSMutableDictionary dictionary]; dict = (NSMutableDictionary*)[self readNexusFile:textFile]; //Separate every block blocksArray = [textFile componentsSeparatedByString:@"BEGIN "]; //Use the block name as the key and the contents as the value for (i = 1; i < [blocksArray count]; i++) { scanner = [[NSScanner alloc] initWithString:[blocksArray objectAtIndex:i]]; [scanner scanUpToString:@";" intoString:&blockName]; [scanner scanUpToString:@"end;" intoString:&blockContents]; [scanner release]; [blocksDictionary setObject:blockContents forKey:blockName]; } [dict setObject:blocksDictionary forKey:@"blocks"]; return dict; } - (NSDictionary *)readSwissProtFile:(NSString *)textFile { NSString *line, *sequence, *ID, *description, *organism; NSMutableArray *linesArray; NSMutableDictionary *swissProtDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *matrixDictionary = [NSMutableDictionary dictionary]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity:10]; int i; linesArray = [textFile splitLines]; // to be sure, make all strings empty ID = @""; organism = @""; sequence = @""; description = @""; for (i = 0; i < [linesArray count]; i++) { line = [linesArray objectAtIndex:i]; if ( [line hasPrefix:@"ID"] ) { ID = [ID stringByAppendingString: [line substringFromIndex:2]]; } else if ( [line hasPrefix:@"OS"] ) { organism = [organism stringByAppendingString: [line substringFromIndex:2]]; } else if ( [line hasPrefix:@"DE"] ) { description = [description stringByAppendingString: [line substringFromIndex:2]]; } else if ([line hasPrefix:@"SQ"] ) { line = [linesArray objectAtIndex: ++i]; while (![line hasPrefix:@"//"] ) { sequence = [sequence stringByAppendingString:[line stringByRemovingWhitespace]]; line = [linesArray objectAtIndex: ++i]; } } } // Put the key-value pairs in the swissProtDictionary [itemArray addObject:ID]; [matrixDictionary setObject:sequence forKey:ID]; [swissProtDictionary setObject:matrixDictionary forKey:@"matrix"]; [swissProtDictionary setObject:itemArray forKey:@"items"]; [swissProtDictionary setObject:description forKey:@"comments"]; [swissProtDictionary setObject:organism forKey:@"organism"]; [swissProtDictionary setObject:@"swissprot" forKey:@"fileType"]; return swissProtDictionary; } - (NSDictionary *)readPDBFile:(NSString *)textFile { NSString *line, *sequence, *header, *title, *source; NSMutableArray *linesArray; NSMutableDictionary *pdbDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *matrixDictionary = [NSMutableDictionary dictionary]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity:10]; int i; linesArray = [textFile splitLines]; // to be sure, make all strings empty header = @""; source = @""; sequence = @""; title = @""; for (i = 0; i < [linesArray count]; i++) { line = [linesArray objectAtIndex:i]; if ( [line hasPrefix:@"HEADER"] ) { header = [header stringByAppendingString: [line substringFromIndex:10]]; } else if ( [line hasPrefix:@"SOURCE"] ) { source = [source stringByAppendingString: [line substringFromIndex:10]]; } else if ( [line hasPrefix:@"TITLE"] ) { title = [title stringByAppendingString: [line substringFromIndex:10]]; } else if ([line hasPrefix:@"SEQRES"] ) { sequence = [sequence stringByAppendingString:[line substringWithRange:NSMakeRange(19, 52)]]; } } // Put the key-value pairs in the ncbiDictionary [itemArray addObject:header]; [matrixDictionary setObject:sequence forKey:header]; [pdbDictionary setObject:matrixDictionary forKey:@"matrix"]; [pdbDictionary setObject:itemArray forKey:@"items"]; [pdbDictionary setObject:title forKey:@"comments"]; [pdbDictionary setObject:source forKey:@"organism"]; [pdbDictionary setObject:@"pdb" forKey:@"fileType"]; return pdbDictionary; } - (NSDictionary *)readNCBIFile:(NSString *)textFile { NSString *line, *sequence, *locus, *definition, *organism; NSMutableArray *linesArray; NSMutableDictionary *ncbiDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *matrixDictionary = [NSMutableDictionary dictionary]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity:10]; int i; linesArray = [textFile splitLines]; // to be sure, make all strings empty locus = @""; organism = @""; sequence = @""; definition = @""; for (i = 0; i < [linesArray count]; i++) { line = [linesArray objectAtIndex:i]; if ( [line hasPrefix:@"LOCUS"] ) { locus = [locus stringByAppendingString: [line substringFromIndex:11]]; } else if ( [line hasPrefix:@"ORGANISM"] ) { organism = [organism stringByAppendingString: [line substringFromIndex:11]]; } else if ( [line hasPrefix:@"DEFINITION"] ) { definition = [definition stringByAppendingString: [line substringFromIndex:11]]; } else if ([line hasPrefix:@"ORIGIN"] ) { line = [linesArray objectAtIndex: ++i]; while (![line hasPrefix:@"//"] ) { sequence = [sequence stringByAppendingString:[[line substringFromIndex:10] stringByRemovingWhitespace]]; line = [linesArray objectAtIndex: ++i]; } } } // Put the key-value pairs in the ncbiDictionary [itemArray addObject:locus]; [matrixDictionary setObject:sequence forKey:locus]; [ncbiDictionary setObject:matrixDictionary forKey:@"matrix"]; [ncbiDictionary setObject:itemArray forKey:@"items"]; [ncbiDictionary setObject:definition forKey:@"comments"]; [ncbiDictionary setObject:organism forKey:@"organism"]; [ncbiDictionary setObject:@"ncbi" forKey:@"fileType"]; return ncbiDictionary; } - (NSMutableString *)convertLineBreaksToMac:(NSString *)textFile { // \r\n (Windows) becomes \r\r - \n (Unix) becomes \r NSMutableString *theString = [NSMutableString stringWithString:textFile]; [theString replaceOccurrencesOfString:@"\r\n" withString:@"\r" options:NULL range:NSMakeRange(0, [theString length])]; [theString replaceOccurrencesOfString:@"\n" withString:@"\r" options:NULL range:NSMakeRange(0, [theString length])]; return theString; } - (NSString *)detectLineBreak:(NSString *)srcNStr { // search for dos if ([srcNStr rangeOfString: @"\r\n"].location != NSNotFound) return @"\r\n"; // search for mac else if ([srcNStr rangeOfString: @"\n"].location != NSNotFound) return @"\n"; // search for unix else if ([srcNStr rangeOfString: @"\n"].location != NSNotFound) return @"\n"; // otherwise unknown else return @"\r"; } // Memory management - (id)init { if (self = [super init]) { } return self; } - (void)dealloc { [super dealloc]; } @end biococoa-2.2.2/BCFoundation/BCSequenceIO/BCSequenceReader.h000644 000765 000024 00000011245 11223237412 023726 0ustar00scottcstaff000000 000000 // // BCSequenceReader.h // BioCocoa // // Created by Koen van der Drift on 10/16/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import @class BCSequence; @class BCSequenceArray; typedef struct strider_header { char versionNb; char type; char topology; char reserved1; int reserved2; int reserved3; int reserved4; char reserved5; char filler1; short filler2; int filler3; int reserved6; int nLength; int nMinus; int reserved7; int reserved8; int reserved9; int reserved10; int reserved11; char reserved12[32]; short reserved13; short filler4; char reserved14; char reserved15; char reserved16; char filler5; int com_length; int reserved17; int filler6; int filler7; }STRIDER_HEADER; typedef struct gck_header { int unknown1; int unknown2; int unknown3; int unknown4; int unknown5; int unknown6; int unknown7; int nLength; }GCK_HEADER; typedef struct macvector_header { char seqType; // 0: nucleic, else: protein char empty1; char empty2; char topology; // 0: linear, else: circular char empty3; char empty4; char ntType; // 1: RNA, else: DNA char empty5; char month; // 1-12 char day; // 1-31 char year; // 0-255 + 1900 int empty6; int nSegments; // always 1. Total number of sequences, BTW int totalLength; // equal to sequence length (nSegments = 1) int segNo; // Number of segment (always 1?) int seqLength; // this segment length int seqBytes; // this segment length again (???) }MACVECTOR_HEADER; // // File formats // typedef enum _BCFileFormat { BCFastaFileFormat, BCSwissProtFileFormat, BCPDBFileFormat, BCNCBIFileFormat, BCClustalFileFormat, BCStriderFileFormat, BCGCKFileFormat, BCMacVectorFileFormat, BCGDEFFileFormat, BCPirFileFormat, BCMSFFileFormat, BCPhylipFileFormat, BCNonaFileFormat, BCHenningFileFormat, BCFASTQFileFormat } BCFileFormat; @interface BCSequenceReader : NSObject { } - (BCSequenceArray *)readFileUsingText:(NSString *)textFile; - (BCSequenceArray *)readFileUsingData:(NSData *)dataFile; - (BCSequenceArray *)readFileUsingPath:(NSString *)filePath; - (BCSequenceArray *)readFileUsingPath:(NSString *)filePath format:(BCFileFormat)aFormat; - (BCSequenceArray *)readFastaFile:(NSString *)textFile; - (BCSequenceArray *)readSwissProtFile:(NSString *)textFile; - (BCSequenceArray *)readPDBFile:(NSString *)textFile; - (BCSequenceArray *)readNCBIFile:(NSString *)textFile; - (BCSequenceArray *)readClustalFile:(NSString *)textFile; - (BCSequenceArray *)readStriderFile:(NSString *)textFile; - (BCSequenceArray *)readGCKFile:(NSString *)textFile; - (BCSequenceArray *)readMacVectorFile:(NSString *)textFile; - (BCSequenceArray *)readGDEFile:(NSString *)entryString; - (BCSequenceArray *)readPirFile:(NSString *)entryString; - (BCSequenceArray *)readMSFFile:(NSString *)entryString; - (BCSequenceArray *)readPhylipFile:(NSString *)entryString; - (BCSequenceArray *)readRawFile:(NSString *)entryString; - (BCSequenceArray *)readFASTQFile:(NSString *)textFile; //- (BCSequenceArray *)readNonaFile:(NSString *)entryString; //- (BCSequenceArray *)readHennigFile:(NSString *)entryString; @end biococoa-2.2.2/BCFoundation/BCSequenceIO/BCSequenceReader.m000644 000765 000024 00000153172 11455660036 023752 0ustar00scottcstaff000000 000000 // // BCSequenceReader.m // BioCocoa // // Created by Koen van der Drift on 10/16/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCSequenceReader.h" #import "BCUtilStrings.h" #import "BCSequence.h" #import "BCAnnotation.h" #import "BCSymbolSet.h" #import "BCSequenceArray.h" #import "BCFoundationDefines.h" #import "BCInternal.h" @implementation BCSequenceReader - (BCSequenceArray *)readFileUsingPath:(NSString *)filePath { BCSequenceArray *result = nil; if([NSHFSTypeOfFile(filePath) isEqualToString: @"'xDNA'"]) { result = [self readStriderFile: filePath]; } else if([NSHFSTypeOfFile(filePath) isEqualToString: @"'GCKc'"] || [NSHFSTypeOfFile(filePath) isEqualToString: @"'GCKs'"]) { result = [self readGCKFile: filePath]; } else if ([NSHFSTypeOfFile(filePath) isEqualToString: @"'PROT'"] || [NSHFSTypeOfFile(filePath) isEqualToString: @"'NUCL'"]) { result = [self readMacVectorFile: filePath]; } else // TEXT file { NSMutableString *sequenceFileContents; // First test for EXDNA if([[filePath pathExtension] isEqualToString: @"exdna"]) { sequenceFileContents = [NSMutableString stringWithContentsOfFile: [filePath stringByAppendingPathComponent: @"sequence.txt"]]; } else { if ([[NSFileManager defaultManager] fileExistsAtPath: filePath]) { sequenceFileContents = [NSMutableString stringWithContentsOfFile: filePath]; } else { // were actually dealing with a string input here, not a file sequenceFileContents = [NSMutableString stringWithString: filePath]; } } result = [self readFileUsingText: sequenceFileContents]; } return result; } - (BCSequenceArray *)readFileUsingPath:(NSString *)filePath format:(BCFileFormat)aFormat { BCSequenceArray *result = nil; NSMutableString *sequenceFileContents; switch (aFormat) { case BCFastaFileFormat: sequenceFileContents = [NSMutableString stringWithContentsOfFile: filePath]; result = [self readFastaFile: sequenceFileContents]; break; case BCSwissProtFileFormat: sequenceFileContents = [NSMutableString stringWithContentsOfFile: filePath]; result = [self readSwissProtFile: sequenceFileContents]; break; case BCPDBFileFormat: sequenceFileContents = [NSMutableString stringWithContentsOfFile: filePath]; result = [self readPDBFile: sequenceFileContents]; break; case BCNCBIFileFormat: sequenceFileContents = [NSMutableString stringWithContentsOfFile: filePath]; result = [self readNCBIFile: sequenceFileContents]; break; case BCClustalFileFormat: sequenceFileContents = [NSMutableString stringWithContentsOfFile: filePath]; result = [self readClustalFile: sequenceFileContents]; break; case BCStriderFileFormat: result = [self readStriderFile: filePath]; break; case BCGCKFileFormat: result = [self readGCKFile: filePath]; break; case BCMacVectorFileFormat: result = [self readMacVectorFile: filePath]; break; case BCGDEFFileFormat: sequenceFileContents = [NSMutableString stringWithContentsOfFile: filePath]; result = [self readGDEFile: sequenceFileContents]; break; case BCPirFileFormat: sequenceFileContents = [NSMutableString stringWithContentsOfFile: filePath]; result = [self readPirFile: sequenceFileContents]; break; case BCMSFFileFormat: break; case BCPhylipFileFormat: sequenceFileContents = [NSMutableString stringWithContentsOfFile: filePath]; result = [self readPhylipFile: sequenceFileContents]; break; case BCNonaFileFormat: break; case BCHenningFileFormat: break; case BCFASTQFileFormat: sequenceFileContents = [NSMutableString stringWithContentsOfFile: filePath]; result = [self readFASTQFile: sequenceFileContents]; break; } return result; } - (BCSequenceArray *)readFileUsingData:(NSData *)dataFile { NSString *entryString = [[NSString alloc] initWithData: dataFile encoding: NSASCIIStringEncoding]; // or NSUTF8StringEncoding ? return [self readFileUsingText: [entryString autorelease]]; } - (BCSequenceArray *)readFileUsingText:(NSString *)entryString { BCSequenceArray *result = nil; // RTF? if ([entryString hasCaseInsensitivePrefix: @"{\\rtf1"]) { // convert rtf string to a plain text string NSAttributedString *rtfstring = [[NSAttributedString alloc] initWithRTF: [entryString dataUsingEncoding: NSUTF8StringEncoding] documentAttributes: nil]; entryString = [rtfstring string]; [rtfstring release]; } // // should we also filter for HTML? Probably the best way to test whether we are dealing for a html file is to check for the last // // html tag, which is alway . Looking for the first tag won't work, since that varies too much. // if ([entryString hasCaseInsensitiveSuffix: @""]) // { // NSAttributedString *htmlstring = [[NSAttributedString alloc] initWithHTML: [NSData dataWithContentsOfFile: entryString] documentAttributes: nil]; // [sequenceFileContents setString: [htmlstring string]]; // [htmlstring release]; // } // DETERMINE TYPE if ([entryString hasCaseInsensitivePrefix:@"#NEXUS"] || [entryString hasCaseInsensitivePrefix:@"#PAUP"]) { //result = [self readNexusFileAndBlocks: entryString]; } else if ([entryString hasCaseInsensitivePrefix: @"proc/"]) { //result = [self readNonaFile: entryString]; } else if ([entryString hasCaseInsensitivePrefix: @"xread"]) { //result = [self readHennigFile: entryString]; } else if ([entryString hasCaseInsensitivePrefix: @"CLUSTAL"]) { result = [self readClustalFile: entryString]; } else if ([entryString hasCaseInsensitivePrefix: @"!!NA_"] || [entryString hasCaseInsensitivePrefix: @"!!AA_"] ) { //result = [self readMSFFile: entryString]; } else if ([entryString hasPrefix:@">"]) { if ([entryString characterAtIndex: 3] == ';') { result = [self readPirFile: entryString]; } else { result = [self readFastaFile: entryString]; } } else if ([entryString hasPrefix:@"HEADER"]) { result = [self readPDBFile: entryString]; } else if ([entryString hasPrefix:@"LOCUS"]) { result = [self readNCBIFile: entryString]; } else if ([entryString hasPrefix:@"#"]) { result = [self readGDEFile: entryString]; } else if ([entryString hasPrefix:@"ID"]) { result = [self readSwissProtFile: entryString]; } else if ([entryString stringBeginsWithTwoNumbers]) { result = [self readPhylipFile: entryString]; } else { result = [self readRawFile: entryString]; // Assumes sequences are in plain format } return result; } - (BCSequenceArray *) readFastaFile:(NSString *)entryString { #if 1 BCSequenceArray *result; NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int cnt = [entryString length]; result = [[BCSequenceArray alloc] init]; //printf("Allocating %d bytes.\n", cnt + 1); char *seq1 = (char *)malloc(sizeof(char) * (cnt + 1)); if (!seq1) { NSLog(@"Not enough memory to load sequence file.\n"); return nil; } bzero(seq1, cnt + 1); //printf("Loading file.\n"); NSUInteger start, end, next; NSRange range; BCAnnotation *d = nil; int seqLen = 0; const char *dataBuffer = [entryString UTF8String]; unsigned stringLength = [entryString length]; range.location = 0; range.length = 1; do { [entryString getLineStart:&start end:&next contentsEnd:&end forRange:range]; range.location = start; range.length = end-start; if ([entryString characterAtIndex: start] == '>') { // FASTA header, separate sequences // save the previous sequence that just ended if (d) { NSData *finalData = [NSData dataWithBytes: seq1 length: seqLen]; BCSequence *newSequence = [[BCSequence alloc] initWithData: finalData symbolSet: nil]; [newSequence addAnnotation: d]; [result addSequence: newSequence]; } seqLen = 0; // FASTA header annotation ++range.location; --range.length; d = [BCAnnotation annotationWithName: @">" content: [entryString substringWithRange: range]]; } else { // sequence segment memcpy(&(seq1[seqLen]), &(dataBuffer[range.location]), range.length); seqLen += range.length; } range.location = next; range.length = 1; } while (next < stringLength); // save the last sequence NSData *finalData = [NSData dataWithBytes: seq1 length: seqLen]; free(seq1); BCSequence *newSequence = [[BCSequence alloc] initWithData: finalData symbolSet: nil]; [newSequence addAnnotation: d]; [result addSequence: newSequence]; [pool release]; #else BCSequence *newSequence; NSMutableArray *linesArray, *annotationsArray; BCSequenceArray *result; NSString *line, *sequenceString; int i, j; linesArray = [entryString splitLines]; result = [[BCSequenceArray alloc] init]; annotationsArray = [NSMutableArray array]; for (i = 0; i < [linesArray count]; i++) { line = [linesArray objectAtIndex: i]; if ([line hasPrefix: @">"] ) { [annotationsArray addObject: [BCAnnotation annotationWithName: @">" content: [line substringFromIndex: 1]]]; line = [linesArray objectAtIndex: ++i]; sequenceString = @""; // until the next sequence while (![line hasPrefix:@">"] ) { sequenceString = [sequenceString stringByAppendingString: [line stringByRemovingWhitespace]]; i++; if ( i < [linesArray count]) { line = [linesArray objectAtIndex: i]; } else break; } // we don't know what the sequence type is going to be, so we will let the // creation code figure that out newSequence = [BCSequence sequenceWithString: sequenceString]; for (j = 0; j < [annotationsArray count]; j++) { [newSequence addAnnotation: [annotationsArray objectAtIndex:j]]; } [result addSequence: newSequence]; [annotationsArray removeAllObjects]; i--; } } #endif return result; } - (BCSequenceArray *) readSwissProtFile:(NSString *)entryString { // TODO: need to make a nested annotation for the reference entries NSString *line, *sequenceString; NSMutableArray *linesArray, *annotationsArray; BCSequenceArray *result; BCSequence *newSequence; int i, j; linesArray = [entryString splitLines]; annotationsArray = [NSMutableArray array]; result = [[BCSequenceArray alloc] init]; for (i = 0; i < [linesArray count]; i++) { line = [linesArray objectAtIndex: i]; if (![line hasPrefix:@"SQ"]) { if ( ![line hasPrefix:@"XX"]) { [annotationsArray addObject:[BCAnnotation annotationWithName: [line substringToIndex: 2] content: [line substringFromIndex: 3]]]; } } else { // will extract the sequence here line = [linesArray objectAtIndex: ++i]; sequenceString = @""; while (![line hasPrefix:@"//"] ) { sequenceString = [sequenceString stringByAppendingString:[line stringByRemovingWhitespace]]; line = [linesArray objectAtIndex: ++i]; } } } if ( [sequenceString length]) { // if it's an embl file it could be a dna or rna sequence, // so don't set symbolset to protein, even though it's called the swiss prot format newSequence = [BCSequence sequenceWithString: sequenceString]; for (j = 0; j < [annotationsArray count]; j++) { [newSequence addAnnotation:[annotationsArray objectAtIndex:j]]; } [result addSequence: newSequence]; [annotationsArray removeAllObjects]; } return result; } - (BCSequenceArray *)readPDBFile:(NSString *)entryString { NSString *line, *sequenceString; NSMutableArray *linesArray, *annotationsArray; BCSequenceArray *result; BCSequence *newSequence; int i, j; linesArray = [entryString splitLines]; result = [[BCSequenceArray alloc] init]; annotationsArray = [NSMutableArray array]; sequenceString = @""; for (i = 0; i < [linesArray count]; i++) { line = [linesArray objectAtIndex:i]; if ( ![line hasPrefix:@"SEQRES"] ) { [annotationsArray addObject:[BCAnnotation annotationWithName: [line substringToIndex: 10] content: [line substringFromIndex: 11]]]; } else { sequenceString = [sequenceString stringByAppendingString:[line substringWithRange:NSMakeRange(19, 52)]]; } } if ( [sequenceString length]) { newSequence = [BCSequence sequenceWithThreeLetterString: sequenceString symbolSet: [BCSymbolSet proteinSymbolSet]]; for (j = 0; j < [annotationsArray count]; j++) { [newSequence addAnnotation:[annotationsArray objectAtIndex:j]]; } [result addSequence: newSequence]; [annotationsArray removeAllObjects]; } return result; } - (BCSequenceArray *)readNCBIFile:(NSString *)entryString { NSString *line, *sequenceString; NSMutableArray *linesArray, *annotationsArray; BCSequenceArray *result; BCSequence *newSequence; int i, j; linesArray = [entryString splitLines]; result = [[BCSequenceArray alloc] init]; annotationsArray = [NSMutableArray array]; sequenceString = @""; for (i = 0; i < [linesArray count]; i++) { line = [linesArray objectAtIndex:i]; if (![line hasPrefix:@"ORIGIN"] ) { [annotationsArray addObject:[BCAnnotation annotationWithName: [line substringToIndex:10] content: [line substringFromIndex:11]]]; } else { line = [linesArray objectAtIndex: ++i]; while (![line hasPrefix:@"//"] ) { sequenceString = [sequenceString stringByAppendingString:[[line substringFromIndex:10] stringByRemovingWhitespace]]; line = [linesArray objectAtIndex: ++i]; } if ( [sequenceString length]) { newSequence = [BCSequence sequenceWithString: sequenceString]; for (j = 0; j < [annotationsArray count]; j++) { [newSequence addAnnotation:[annotationsArray objectAtIndex:j]]; } [result addSequence: newSequence]; [annotationsArray removeAllObjects]; } } } return result; } - (BCSequenceArray *)readStriderFile:(NSString *)textFile { /* Binary file format, read in header, determine features and sequence -> create dictionary. */ STRIDER_HEADER *signature; BCSequence *newSequence; BCSequenceArray *result; NSString *sequenceString; NSMutableArray *annotationsArray; int i; result = [[BCSequenceArray alloc] init]; annotationsArray = [NSMutableArray array]; sequenceString = @""; NSData *data = [NSData dataWithContentsOfFile: textFile]; // Memory alloc and read in struct signature = malloc(sizeof(STRIDER_HEADER)); [data getBytes: signature length: sizeof(STRIDER_HEADER)]; // Sequence NSData *seqdata = [data subdataWithRange: NSMakeRange(sizeof(STRIDER_HEADER), CFSwapInt32BigToHost(signature->nLength))]; sequenceString = [sequenceString stringByAppendingString: [NSString stringWithBytes: [seqdata bytes] length: [seqdata length] encoding: NSASCIIStringEncoding]]; [annotationsArray addObject: [BCAnnotation annotationWithName: @"name" content: [[textFile lastPathComponent]stringByDeletingPathExtension]]]; // Comments if(signature->com_length > 0) { NSData *comdata = [data subdataWithRange: NSMakeRange([data length] - CFSwapInt32BigToHost(signature->com_length), CFSwapInt32BigToHost(signature->com_length))]; NSString *comments = [[NSString alloc] initWithBytes: [comdata bytes] length: [comdata length] encoding: NSASCIIStringEncoding]; [annotationsArray addObject: [BCAnnotation annotationWithName: @"comments" content: comments]]; [comments release]; } if ( [sequenceString length]) { newSequence = [BCSequence sequenceWithString: sequenceString]; for (i = 0; i < [annotationsArray count]; i++) { [newSequence addAnnotation: [annotationsArray objectAtIndex: i]]; } [result addSequence: newSequence]; [annotationsArray removeAllObjects]; } // Clean up free(signature); return result; } - (BCSequenceArray *)readGCKFile:(NSString *)textFile { /* Binary file format, read in header, determine features and sequence -> create dictionary. Same as DNA strider but comments are ignored */ GCK_HEADER *signature; BCSequence *newSequence; BCSequenceArray *result; NSString *sequenceString; NSMutableArray *annotationsArray; int i; result = [[BCSequenceArray alloc] init]; annotationsArray = [NSMutableArray array]; sequenceString = @""; NSData *data = [NSData dataWithContentsOfFile: textFile]; // Memory alloc and read in struct signature = malloc(sizeof(GCK_HEADER)); [data getBytes: signature length: sizeof(GCK_HEADER)]; // Sequence NSData *seqdata = [data subdataWithRange: NSMakeRange(sizeof(GCK_HEADER), CFSwapInt32BigToHost(signature->nLength))]; sequenceString = [sequenceString stringByAppendingString: [NSString stringWithBytes: [seqdata bytes] length: [seqdata length] encoding: NSASCIIStringEncoding]]; [annotationsArray addObject: [BCAnnotation annotationWithName: @"name" content: [[textFile lastPathComponent]stringByDeletingPathExtension]]]; if ( [sequenceString length]) { newSequence = [BCSequence sequenceWithString: sequenceString]; for (i = 0; i < [annotationsArray count]; i++) { [newSequence addAnnotation: [annotationsArray objectAtIndex: i]]; } [result addSequence: newSequence]; [annotationsArray removeAllObjects]; } // Clean up free(signature); return result; } - (BCSequenceArray *)readMacVectorFile:(NSString *)textFile { MACVECTOR_HEADER *signature; BCSequence *newSequence; BCSequenceArray *result; NSMutableArray *annotationsArray; NSString *alphabet; unsigned char *seqBuffer; int i, s; NSMutableString *sequenceString = [NSMutableString string]; result = [[BCSequenceArray alloc] init]; annotationsArray = [NSMutableArray array]; NSData *data = [NSData dataWithContentsOfFile: textFile]; // get header data signature = malloc(sizeof(MACVECTOR_HEADER)); [data getBytes: signature length: sizeof(MACVECTOR_HEADER)]; /* define the alphabet so that we can read proteins, DNA and RNA I'm not sure this is the most elegant way to do things... It works, anyway. Bytes in MacVector files corresponds to letters in alphabet The idea is to use the alphabet as an array so that when one reads, say 0x02, has just to get character at index 2 in the alphabet... */ if (signature->seqType) { // Protein alphabet = @"-ACDEFGHIKLMNPQRSTVWYB*X"; } else if (signature->ntType == 1) { // RNA, there are no T's, only U's alphabet = @"-ACMGRSVUWYHKDBN"; } else { // DNA alphabet = @"-ACMGRSVTWYHKDBN"; } // get the length in a variable, so that we don't have to convert every time... s = CFSwapInt32BigToHost(signature->seqLength); // read the sequence into a data object NSData *seqdata = [data subdataWithRange:NSMakeRange(sizeof(MACVECTOR_HEADER),s)]; // Now I need to read the data bytes //seqBuffer = malloc(s); seqBuffer = (unsigned char *)[seqdata bytes]; for (i = 0; i < s; i++) { // append each character [sequenceString appendFormat:@"%c", [alphabet characterAtIndex:seqBuffer[i]]]; } /* What follows is copied from the method above, readGCKFile I've only commented lines that have to do with reading annotations. */ if ([sequenceString length]) { newSequence = [BCSequence sequenceWithString: sequenceString]; [result addSequence: newSequence]; } free(signature); return result; } -(BCSequenceArray *)readClustalFile:(NSString *)entryString { /* The clustal format can have a sequence that is displayed over several lines, each starting with an identifier: CLUSTAL_FORMAT W(1.60) multiple sequence alignment JC2395 NVSDVNLNK---YIWRTAEKMK---ICDAKKFARQHKIPESKIDEIEHNSPQDAAE---- KPEL_DROME MAIRLLPLPVRAQLCAHLDAL-----DVWQQLATAVKLYPDQVEQISSQKQRGRS----- FASA_MOUSE NASNLSLSK---YIPRIAEDMT---IQEAKKFARENNIKEGKIDEIMHDSIQDTAE---- JC2395 -------------------------QKIQLLQCWYQSHGKT--GACQALIQGLRKANRCD KPEL_DROME -------------------------ASNEFLNIWGGQYN----HTVQTLFALFKKLKLHN FASA_MOUSE -------------------------QKVQLLLCWYQSHGKS--DAYQDLIKGLKKAECRR JC2395 IAEEIQAM KPEL_DROME AMRLIKDY FASA_MOUSE TLDKFQDM so the algorithm is: scan name, until space. scan sequencestring store name-sequence pair in a dictionary scan next line, if key exists, append string, otherwise, add new key-value pair If done, gone through dictionary, and extract the name and sequence make BCSequence, and add name as an attribute store BCSequence in array to return */ int i; NSString *line, *name, *sequenceString, *tempString; NSMutableArray *linesArray; NSScanner *lineScanner; BCSequence *newSequence; NSCharacterSet *alignmentSet, *symbolSet; BCSequenceArray *result; NSMutableDictionary *sequenceDictionary; NSRange sequenceRange; alignmentSet = [NSCharacterSet characterSetWithCharactersInString: @"*:."]; symbolSet = [[NSCharacterSet whitespaceCharacterSet] invertedSet]; // or actually all BCSymbolSets! sequenceDictionary = [NSMutableDictionary dictionary]; result = [[BCSequenceArray alloc] init]; linesArray = [entryString splitLines]; // remove empty lines for (i = [linesArray count] - 1; i >= 0 ; i--) { if ([[linesArray objectAtIndex: i] isEqualTo: @""]) { [linesArray removeObjectAtIndex: i]; } } // since this is an alignment, we need to determine where the first whitespace is that belongs to the sequence for (i = 1; i < [linesArray count]; i++) { line = [linesArray objectAtIndex: i]; // we now have the first sequence line, let's determine where the sequence starts. // first scan past the name lineScanner = [NSScanner scannerWithString: line]; [lineScanner scanUpToString:@" " intoString: nil]; // put the left-over in a tempstring tempString = [line substringFromIndex: [lineScanner scanLocation]]; // now check where the first non-whitecharacter is sequenceRange = [tempString rangeOfCharacterFromSet: symbolSet]; // add the scanLocation - this is where the sequence starts sequenceRange.location += [lineScanner scanLocation]; // found it, no need to continue break; } for (i = 1; i < [linesArray count]; i++) { line = [linesArray objectAtIndex:i]; // scan the name lineScanner = [NSScanner scannerWithString: line]; [lineScanner scanUpToString: @" " intoString: &name]; // the rest of the line after the whitespace is the sequence sequenceString = [line substringFromIndex: sequenceRange.location]; // make sure we actually have a string if ( [sequenceString length]) { // if it's the alignment line, name it "alignment" if ( [sequenceString stringContainsCharactersFromSet: alignmentSet] ) { name = [NSString stringWithString: @"alignment"]; } if ( [sequenceDictionary objectForKey: name] ) { tempString = (NSMutableString*)[[sequenceDictionary objectForKey: name] stringByAppendingString:sequenceString]; [sequenceDictionary setObject: tempString forKey: name]; } else { [sequenceDictionary setObject: sequenceString forKey: name]; } } } // now replace the sequencestrings in the dictionary with BCSequenceObjects NSEnumerator *enumerator = [sequenceDictionary keyEnumerator]; while ( (name = [enumerator nextObject]) ) { sequenceString = [[sequenceDictionary objectForKey: name] stringByRemovingWhitespace]; newSequence = [BCSequence sequenceWithString:sequenceString]; [newSequence addAnnotation: [BCAnnotation annotationWithName: @"name" content: name]]; [result addSequence: newSequence]; } return result; } -(BCSequenceArray *)readGDEFile:(NSString *)entryString { /* #sf170-A3 atgggaccagagtctaaagccatgtgtaaagttaacccctctctgcgttactttaaattgtagccat- #br20-B1 atgggatcaaagcctaaagccttgtgtaaagttaaccccactctgtgttactttaaattgcattgatttgaa */ NSString *line, *sequenceString; NSMutableArray *linesArray, *annotationsArray; BCSequenceArray *result; BCSequence *newSequence; int i, j; linesArray = [entryString splitLines]; result = [[BCSequenceArray alloc] init]; annotationsArray = [NSMutableArray array]; sequenceString = @""; // remove empty lines for (i = [linesArray count] - 1; i >= 0 ; i--) { if ([[linesArray objectAtIndex: i] isEqualTo: @""]) { [linesArray removeObjectAtIndex: i]; } } for (i = 0; i < [linesArray count]; i++) { line = [linesArray objectAtIndex:i]; if ([line hasPrefix: @"#"] ) { [annotationsArray addObject:[BCAnnotation annotationWithName: @"name" content: line]]; line = [linesArray objectAtIndex: ++i]; sequenceString = @""; // until the next sequence while (![line hasPrefix: @"#"] ) { sequenceString = [sequenceString stringByAppendingString: [line stringByRemovingWhitespace]]; i++; if ( i < [linesArray count]) { line = [linesArray objectAtIndex: i]; } else break; } // we don't know what the sequence type is going to be, so we will let the // creation code figure that out newSequence = [BCSequence sequenceWithString: sequenceString]; for (j = 0; j < [annotationsArray count]; j++) { [newSequence addAnnotation: [annotationsArray objectAtIndex:j]]; } [result addSequence: newSequence]; [annotationsArray removeAllObjects]; i--; } } return result; } -(BCSequenceArray *)readPirFile:(NSString *)entryString { /* >P1;CRAB_ANAPL ALPHA CRYSTALLIN B CHAIN (ALPHA(B)-CRYSTALLIN). MDITIHNPLI RRPLFSWLAP SRIFDQIFGE HLQESELLPA SPSLSPFLMR SPIFRMPSWL ETGLSEMRLE KDKFSVNLDV KHFSPEELKV KVLGDMVEIH GKHEERQDEH GFIAREFNRK YRIPADVDPL TITSSLSLDG VLTVSAPRKQ SDVPERSIPI TREEKPAIAG AQRK* >P1;CRAB_BOVIN ALPHA CRYSTALLIN B CHAIN (ALPHA(B)-CRYSTALLIN). MDIAIHHPWI RRPFFPFHSP SRLFDQFFGE HLLESDLFPA STSLSPFYLR PPSFLRAPSW IDTGLSEMRL EKDRFSVNLD VKHFSPEELK VKVLGDVIEV HGKHEERQDE HGFISREFHR KYRIPADVDP LAITSSLSSD GVLTVNGPRK QASGPERTIP ITREEKPAVT AAPKK* */ NSString *line, *sequenceString; NSMutableArray *linesArray, *annotationsArray; BCSequenceArray *result; BCSequence *newSequence; int i, j; linesArray = [entryString splitLines]; result = [[BCSequenceArray alloc] init]; annotationsArray = [NSMutableArray array]; sequenceString = @""; // remove empty lines for (i = [linesArray count] - 1; i >= 0 ; i--) { if ([[linesArray objectAtIndex: i] isEqualTo: @""]) { [linesArray removeObjectAtIndex: i]; } } for (i = 0; i < [linesArray count]; i++) { line = [linesArray objectAtIndex: i]; if ([line hasPrefix: @">"] ) { [annotationsArray addObject:[BCAnnotation annotationWithName: @"name" content: [line substringFromIndex: 4]]]; line = [linesArray objectAtIndex: ++i]; [annotationsArray addObject:[BCAnnotation annotationWithName: @"description" content: line]]; line = [linesArray objectAtIndex: ++i]; sequenceString = @""; // until the next sequence while (![line hasPrefix: @">"] ) { if ( [line hasSuffix: @"*"]) { line = [line stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString: @"*"]]; } sequenceString = [sequenceString stringByAppendingString: [line stringByRemovingWhitespace]]; i++; if ( i < [linesArray count]) { line = [linesArray objectAtIndex: i]; } else break; } // we don't know what the sequence type is going to be, so we will let the // creation code figure that out newSequence = [BCSequence sequenceWithString: sequenceString]; for (j = 0; j < [annotationsArray count]; j++) { [newSequence addAnnotation: [annotationsArray objectAtIndex:j]]; } [result addSequence: newSequence]; [annotationsArray removeAllObjects]; i--; } } return result; } -(BCSequenceArray *)readMSFFile:(NSString *)entryString { /* msf formatted multiple sequence files are most often created when using programs of the GCG suite. msf files include the sequence name and the sequence itself, which is usually aligned with other sequences in the file. You can specify a single sequence or many sequences within an msf file. An example of part of an msf file, created using the GCG multiple sequence alignment program: !!AA_MULTIPLE_ALIGNMENT 1.0 PileUp of: @hsp70.list Symbol comparison table: GenRunData:blosum62.cmp CompCheck: 6430 GapWeight: 8 GapLengthWeight: 2 hsp70.msf MSF: 743 Type: P October 6, 1998 18:23 Check: 7784 .. Name: S11448 Len: 743 Check: 3635 Weight: 1.00 Name: S06443 Len: 743 Check: 5861 Weight: 1.00 Name: S29261 Len: 743 Check: 7748 Weight: 1.00 // 1 50 S11448 ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~MTFD GAIGIDLGTT YSCVGVWQNE S06443 ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~MTFD GAIGIDLGTT YSCVGVWQNE S29261 ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~MG KIIGIDLGTT NSCVAIMDGT Some of the hallmarks of a msf formatted sequence are the same as a single sequence gcg format file: Begins with the line (all uppercase) !!NA_MULTIPLE_ALIGNMENT 1.0 for nucleic acid sequences or !!AA_MULTIPLE_ALIGNMENT 1.0 for amino acid sequences. Do not edit or delete the file type if its present.(optional) A description line which contains informative text describing what is in the file. You can add this information to the top of the MSF file using a text editor.(optional) A dividing line which contains the number of bases or residues in the sequence, when the file was created, and importantly, two dots (..) which act as a divider between the descriptive information and the following sequence information.(required) msf files contain some other information as well: Name/Weight: The name of each sequence included in the alignment, as well as its length and checksum (both non-editable) and weight (editable).(required) Separating Line. Must include two slashes (//) to divide the name/weight information from the sequence alignment.(required) Multiple Sequence Alignment. Each sequence named in the above Name/Weight lines is included. The alignment allows you to view the relationship among sequences. */ BCSequenceArray *result = nil; return result; } -(BCSequenceArray *)readPhylipFile:(NSString *)entryString { /* The first line of the input file contains the number of species and the number of characters separated by blanks. The information for each species follows, starting with a ten-character species name (which can include punctuation marks and blanks), and continuing with the characters for that species. Phylip format files can be interleaved, as in the example below, or sequential. More information about phylip format is available from the authors at University of Washington. An example phylip format file: 5 100 Rabbit ?????????? ?????????C CAATCTACAC ACGGG-GTAG GGATTACATA Human AGCCACACCC TAGGGTTGGC CAATCTACTC CCAGGAGCAG GGAGGGCAGG Opossum AGCCACACCC CAACCTTAGC CAATAGACAT CCAGAAGCCC AAAAGGCAAG Chicken GCCCGGGGAA GAGGAGGGGC CCGGCGG-AG GCGATAAAAG TGGGGACACA Frog GGATGGAGAA TTAGAGCACT TGTTCTTTTT GCAGAAGCTC AGAATAAACG TTTGGATGGT AG---GATAT GGGCCTACCA TGGCGTTAAC GGGT-AACGY TTTCGACGGT AA---GGTAT TGGCTTACCG TGGCAATGAC AGGT-GACGG TTTCGACGGT AA---GGTAT TGGCTTACCG TGGCAATGAC AGGT-GACGY TTTCGACGGT AA---GGTAT TGGCTTACCG TGGCAATGAC AGGT-GACGG TTTCGATGGT AA---GGTAT TGGCTTACCG TGGCAATGAC AGGT-GACGG */ NSString *line, *sequenceString, *firstLine; NSMutableArray *linesArray, *annotationsArray, *namesArray, *sequenceArray; NSScanner *lineScanner; BCSequenceArray *result; BCSequence *newSequence; int i, j, numSequences, sequenceIndex; linesArray = [entryString splitLines]; result = [[BCSequenceArray alloc] init]; annotationsArray = [NSMutableArray array]; namesArray = [NSMutableArray array]; sequenceArray = [NSMutableArray array]; sequenceString = @""; // remove empty lines for (i = [linesArray count] - 1; i >= 0 ; i--) { if ([[linesArray objectAtIndex: i] isEqualTo: @""]) { [linesArray removeObjectAtIndex: i]; } } firstLine = [linesArray objectAtIndex: 0]; lineScanner = [NSScanner scannerWithString: firstLine]; [lineScanner scanInt: &numSequences]; j = 0; for ( i = 1; i < [linesArray count]; i++) { if ( i <= numSequences ) { line = [linesArray objectAtIndex: i]; [namesArray addObject: [line substringToIndex: 9]]; [sequenceArray addObject: [[line substringFromIndex: 10] stringByRemovingWhitespace]]; } else { line = [linesArray objectAtIndex: i]; sequenceIndex = i - ( j * numSequences ) - 1; sequenceString = [sequenceArray objectAtIndex: sequenceIndex]; sequenceString = [sequenceString stringByAppendingString: [line stringByRemovingWhitespace]]; [sequenceArray replaceObjectAtIndex: sequenceIndex withObject: sequenceString]; } if ( i % numSequences == 0 ) { j++; } } // finally, populate the BCSequenceArray for (i = 0; i < numSequences; i++) { newSequence = [BCSequence sequenceWithString: (NSString *)[sequenceArray objectAtIndex: i]]; [newSequence addAnnotation: [BCAnnotation annotationWithName: @"name" content: (NSString *)[namesArray objectAtIndex: i]]]; [result addSequence: newSequence]; } return result; } - (BCSequenceArray *)readRawFile:(NSString *)entryString { NSString *line, *sequenceString; NSMutableArray *linesArray; BCSequenceArray *result; BCSequence *newSequence; int i; linesArray = [entryString splitLines]; result = [[BCSequenceArray alloc] init]; sequenceString = @""; // remove empty lines for (i = [linesArray count] - 1; i >= 0 ; i--) { if ([[linesArray objectAtIndex: i] isEqualTo: @""]) { [linesArray removeObjectAtIndex: i]; } } for (i = 1; i < [linesArray count]; i++) { line = [linesArray objectAtIndex: i]; sequenceString = [sequenceString stringByAppendingString: [line stringByRemovingWhitespace]]; } newSequence = [BCSequence sequenceWithString: sequenceString]; [result addSequence: newSequence]; return result; } /* FASTQ format, sequence and Phred qualities Here is format information from the following web site: http://maq.sourceforge.net/fastq.shtml Example @EAS54_6_R1_2_1_413_324 CCCTTCTTGTCTTCAGCGTTTCTCC + ;;3;;;;;;;;;;;;7;;;;;;;88 @EAS54_6_R1_2_1_540_792 TTGGCAGGCCAAGGCCGATGGATCA + ;;;;;;;;;;;7;;;;;-;;;3;83 @EAS54_6_R1_2_1_443_348 GTTGCTTCTGGCGTGGGTGGGGGGG +EAS54_6_R1_2_1_443_348 ;;;;;;;;;;;9;7;;.7;393333 FASTQ Format Specification Notations , and so on represents non-terminal symbols. Characters in red are regex-like operators. '\n' stands for the Return key. Syntax := + := @\n\n+[]\n\n := [A-Za-z0-9_.:-]+ := [A-Za-z\n\.~]+ := [!-~\n]+ Requirements * The following '+' is optional, but if it appears right after '+', it should be identical to the following '@'. * The length of is identical the length of . Each character in represents the phred quality of the corresponding nucleotide in . * If the Phred quality is $Q, which is a non-negative integer, the corresponding quality character can be calculated with the following Perl code: $q = chr(($Q<=93? $Q : 93) + 33); where chr() is the Perl function to convert an integer to a character based on the ASCII table. * Conversely, given a character $q, the corresponding Phred quality can be calculated with: $Q = ord($q) - 33; where ord() gives the ASCII code of a character. Solexa/Illumina Read Format The syntax of Solexa/Illumina read format is almost identical to the FASTQ format, but the qualities are scaled differently. Given a character $sq, the following Perl code gives the Phred quality $Q: $Q = 10 * log(1 + 10 ** (ord($sq) - 64) / 10.0)) / log(10); */ - (BCSequenceArray *) readFASTQFile:(NSString *)entryString { BCSequenceArray *result; NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; result = [[BCSequenceArray alloc] init]; NSUInteger start, end, next; NSRange range; BCAnnotation *identity = nil; BCAnnotation *quality = nil; NSData *seqData; unsigned stringLength = [entryString length]; BOOL readingHeader = YES; BOOL readingSequence = NO; range.location = 0; range.length = 1; do { [entryString getLineStart:&start end:&next contentsEnd:&end forRange:range]; range.location = start; range.length = end-start; // Have to differentiate between looking for header lines because the // quality segments can start with the if (readingHeader) { if ([entryString characterAtIndex: start] == '@') { // FASTQ sequences header // save the previous sequence that just ended if (identity) { BCSequence *newSequence = [[BCSequence alloc] initWithData: seqData symbolSet: nil]; [newSequence addAnnotation: identity]; [newSequence addAnnotation: quality]; [result addSequence: newSequence]; } // FASTQ header annotation ++range.location; --range.length; identity = [BCAnnotation annotationWithName: BCAnnotationIdentity content: [entryString substringWithRange: range]]; readingHeader = NO; readingSequence = YES; } if ([entryString characterAtIndex: start] == '+') { // FASTQ quality header readingHeader = NO; readingSequence = NO; } } else { if (readingSequence) { // sequence segment seqData = [[entryString substringWithRange: range] dataUsingEncoding: NSUTF8StringEncoding]; //printf("%s\n", [seqData bytes]); readingHeader = YES; } else { // quality segment quality = [BCAnnotation annotationWithName: @"quality" content: [entryString substringWithRange: range]]; //printf("%s\n", [[entryString substringWithRange: range] UTF8String]); readingHeader = YES; } } range.location = next; range.length = 1; } while (next < stringLength); // save the last sequence BCSequence *newSequence = [[BCSequence alloc] initWithData: seqData symbolSet: nil]; [newSequence addAnnotation: identity]; [newSequence addAnnotation: quality]; [result addSequence: newSequence]; [pool release]; return result; } // TO BE CONVERTED TO BCSEQUENCEARRAY FORMAT: /* - (NSDictionary *)readNexusFile:(NSString *)textFile { Nexus interleaved format, also known as PAUP format is the default output for the PAUP suite of phylogeny programs and is designed to represent DNA sequence only. The entry is headed by the #NEXUS comment line followed on the next line by the application and creation date. There is a blank line between this information and the start of the sequence data including the number of sequences (in this case 1), length, datatype and representation on missing bases (n) and gaps (-). Each of these information lines is ended with a semi-colon (;). A further blank line separates this information from the matrix comment. The sequence is represented on the succeeding lines starting with the sequence identifier and a block of 50 bases. The end of the sequence is denoted by a semi-colon (;). There follows a blank line and further comment lines ending with a semi-colon (;). #NEXUS [TITLE: Written by EMBOSS 28/06/04] begin data; dimensions ntax=1 nchar=450; format interleave datatype=DNA missing=N gap=-; matrix BT006818 atggctgatcagctgaccgaagaacagattgctgaattcaaggaagcctt BT006818 ctccctatttgataaagatggcgatggcaccatcacaacaaaggaacttg BT006818 gaactgtcatgaggtcactgggtcagaacccaacagaagctgaattgcag BT006818 gatatgatcaatgaagtggatgctgatggtaatggcaccattgacttccc BT006818 cgaatttttgactatgatggctagaaaaatgaaagatacagatagtgaag BT006818 aagaaatccgtgaggcattccgagtctttgacaaggatggcaatggttat BT006818 atcagtgcagcagaactacgtcacgtcatgacaaacttaggagaaaaact BT006818 aacagatgaagaagtagatgaaatgatcagagaagcagatattgatggag BT006818 acggacaagtcaactatgaagaattcgtacagatgatgactgcaaaatag ; end; begin assumptions; options deftype=unord; end; int i; NSScanner *matrixScanner, *itemScanner, *commentScanner, *treeScanner; NSString *comments = @""; NSString *treeString = @""; NSString *stringWithMacLineBreaks; NSMutableString *item, *sequence, *tempSequence, *matrix, *bracketsString; NSMutableArray *linesArray, *bracketsArray; NSMutableDictionary *matrixDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *nexusDictionary = [NSMutableDictionary dictionary]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity:10]; NSMutableArray *treesArray = [NSMutableArray arrayWithCapacity:10]; //Extract the Nexus file's main comments commentScanner = [[NSScanner alloc] initWithString:textFile]; [commentScanner scanUpToString:@"[!" intoString:nil]; [commentScanner scanString:@"[!" intoString:nil]; [commentScanner scanUpToString:@"]" intoString:&comments]; [commentScanner release]; //Put the comments in the nexusDictionary if (![comments isEqualTo:@""]) { [nexusDictionary setObject:comments forKey:@"comments"]; } //Check whether a treeblock exists and extract it if ([textFile rangeOfString:@"begin trees;" options:NSCaseInsensitiveSearch||NSBackwardsSearch].length != 0) { treeScanner = [[NSScanner alloc] initWithString:textFile]; [treeScanner scanUpToString:@"begin trees;" intoString:nil]; [treeScanner scanString:@"begin trees;" intoString:nil]; [treeScanner scanUpToString:@"end;" intoString:&treeString]; [treeScanner release]; treesArray = [NSMutableArray arrayWithArray:[treeString componentsSeparatedByString:@";"]]; //Put the trees in the treesArray if ([treesArray count] > 0) { [treesArray removeObjectAtIndex:0]; [treesArray removeObjectAtIndex:[treesArray count]-1]; //NSLog(@"%@", treesArray); [nexusDictionary setObject:treesArray forKey:@"trees"]; } } //Remove other comments (in sequences) between the [] bracketsString = [NSMutableString stringWithString:textFile]; [bracketsString replaceOccurrencesOfString:@"[" withString:@"!!!*" options:NULL range:NSMakeRange(0, [bracketsString length])]; [bracketsString replaceOccurrencesOfString:@"]" withString:@"!!!" options:NULL range:NSMakeRange(0, [bracketsString length])]; bracketsArray = (NSMutableArray *)[bracketsString componentsSeparatedByString:@"!!!"]; for (i = 0; i < [bracketsArray count]; i++) { if ([[bracketsArray objectAtIndex:i]hasPrefix:@"*"]){ [bracketsArray removeObjectAtIndex:i]; } } matrix = (NSMutableString *)[bracketsArray componentsJoinedByString:@""]; //Isolate the matrix matrixScanner = [[NSScanner alloc] initWithString:matrix]; [matrixScanner scanUpToString:@"matrix" intoString:nil]; [matrixScanner scanUpToString:@";" intoString:&matrix]; [matrixScanner release]; //Convert all line breaks to Mac line breaks (\r) stringWithMacLineBreaks = [self convertLineBreaksToMac:matrix]; //Isolate individual lines based on \r linesArray = (NSMutableArray *)[stringWithMacLineBreaks componentsSeparatedByString:@"\r"]; //Trim lines from surrounding whitespaces and remove empty lines for (i = 0; i < [linesArray count]; i++) { [linesArray insertObject:[[linesArray objectAtIndex:i]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] atIndex:i]; [linesArray removeObjectAtIndex:i+1]; if ([[linesArray objectAtIndex:i]isEqualTo:@""]) { [linesArray removeObjectAtIndex:i]; i--; } } //Read item names and sequences and put them in the matrixDictionary for (i = 1; i < [linesArray count]; i++) { itemScanner = [[NSScanner alloc] initWithString:[linesArray objectAtIndex:i]]; [itemScanner scanUpToString:@" " intoString:&item]; sequence = (NSMutableString *)[[linesArray objectAtIndex:i]substringFromIndex:[itemScanner scanLocation]]; if ([matrixDictionary objectForKey:item]) { //If the item already exists tempSequence = [NSMutableString stringWithString:[[matrixDictionary objectForKey:item] stringByAppendingString:sequence]]; [matrixDictionary setObject:tempSequence forKey:item]; } else { //If the item does not yet exist [matrixDictionary setObject:sequence forKey:item]; [itemArray addObject:item]; //Put the item name in the itemArray } [itemScanner release]; } //Remove spaces and tabs from the sequences in the matrixDictionary for (i = 0; i < [itemArray count]; i++) { tempSequence = [NSMutableString stringWithString:[matrixDictionary objectForKey:[itemArray objectAtIndex:i]]]; [tempSequence replaceOccurrencesOfString:@" " withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [tempSequence replaceOccurrencesOfString:@"\t" withString:@"" options:NULL range:NSMakeRange(0, [tempSequence length])]; [matrixDictionary setObject:tempSequence forKey:[itemArray objectAtIndex:i]]; } //Put the matrixDictionary and the items Array in the nexusDictionary [nexusDictionary setObject:matrixDictionary forKey:@"matrix"]; [nexusDictionary setObject:itemArray forKey:@"items"]; [nexusDictionary setObject:@"nexus" forKey:@"fileType"]; return nexusDictionary; } - (NSDictionary *)readNexusFileAndBlocks:(NSString *)textFile { int i; NSMutableDictionary *dict; NSScanner *scanner; NSArray *blocksArray; NSString *blockName, *blockContents; NSMutableDictionary *blocksDictionary = [NSMutableDictionary dictionary]; dict = (NSMutableDictionary*)[self readNexusFile:textFile]; //Separate every block blocksArray = [textFile componentsSeparatedByString:@"BEGIN "]; //Use the block name as the key and the contents as the value for (i = 1; i < [blocksArray count]; i++) { scanner = [[NSScanner alloc] initWithString:[blocksArray objectAtIndex:i]]; [scanner scanUpToString:@";" intoString:&blockName]; [scanner scanUpToString:@"end;" intoString:&blockContents]; [scanner release]; [blocksDictionary setObject:blockContents forKey:blockName]; } [dict setObject:blocksDictionary forKey:@"blocks"]; return dict; } - (NSDictionary *)readNonaFile:(NSString *)textFile { int i, j; NSScanner *itemScanner; NSString *stringWithMacLineBreaks; NSMutableString *item, *sequence, *tempSequence; NSMutableArray *linesArray; NSMutableDictionary *matrixDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *phylipDictionary = [NSMutableDictionary dictionary]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity:10]; j = 0; //Convert all line breaks to Mac line breaks (\r) stringWithMacLineBreaks = [self convertLineBreaksToMac:textFile]; //Isolate individual lines based on \r linesArray = (NSMutableArray*)[stringWithMacLineBreaks componentsSeparatedByString:@"\r"]; //Remove empty lines for (i = 0; i < [linesArray count]; i++) { NSString *string = [linesArray objectAtIndex:i]; if ((![string stringContainsOneSpace] && [string length] < 20) || [string isEqualToString:@""] || [string stringBeginsWithTwoNumbers] || [string stringContainsHyphen]) { [linesArray removeObjectAtIndex:i]; i--; } } //Read item names and sequences and put them in the matrixDictionary. for (i = 0; i < [linesArray count]; i++) { if ([[linesArray objectAtIndex:i] hasPrefix:@" "]) { //If the item name is not present sequence = [linesArray objectAtIndex:i]; tempSequence = (NSMutableString*)[[matrixDictionary objectForKey:[itemArray objectAtIndex:j]] stringByAppendingString:sequence]; [matrixDictionary setObject:tempSequence forKey:[itemArray objectAtIndex:j]]; j++; if (j == [itemArray count]) { j = 0;} } else { //If the item name precedes the sequence itemScanner = [[NSScanner alloc] initWithString:[linesArray objectAtIndex:i]]; [itemScanner scanUpToString:@" " intoString:&item]; sequence = (NSMutableString*)[[linesArray objectAtIndex:i]substringFromIndex:[itemScanner scanLocation]]; [matrixDictionary setObject:sequence forKey:item]; [itemArray addObject:item]; //NSLog(@"Adding item %@", item); [itemScanner release]; } } //Remove spaces and tabs from the sequences in the matrixDictionary for (i = 0; i < [itemArray count]; i++) { tempSequence = [NSMutableString stringWithString:[matrixDictionary objectForKey:[itemArray objectAtIndex:i]]]; [tempSequence replaceOccurrencesOfString:@" " withString:@"" options:(unsigned)NULL range:NSMakeRange(0, [tempSequence length])]; [tempSequence replaceOccurrencesOfString:@"\t" withString:@"" options:(unsigned)NULL range:NSMakeRange(0, [tempSequence length])]; [matrixDictionary setObject:tempSequence forKey:[itemArray objectAtIndex:i]]; } //Put the matrixDictionary and the items Array in the nonaDictionary [phylipDictionary setObject:matrixDictionary forKey:@"matrix"]; [phylipDictionary setObject:itemArray forKey:@"items"]; [phylipDictionary setObject:@"Nona" forKey:@"fileType"]; return phylipDictionary; } - (NSDictionary *)readHennigFile:(NSString *)textFile { Designed for DNA data, the Hennig86 format translates each base into a number where A = 0; T = 1; G = 2; C =3. The start is denoted by the comment xread and is followed on a separate line by the application and creation date of the file enclosed in single quotes separated from the text by whitespace. A separate line records the sequence length and number of sequence files represented (in this case 1). Immediately below this line is the identifier line and below this the sequence in numerical form. The end of the entry is denoted by a semi-colon (;). The entire sequence is displayed on a single line. xread ' Written by EMBOSS 28/06/04 ' 450 1 BT006818 012231201302312033200200302011231200113002200233113133310111201000201223201223033013030030002200311220031213012022130312221302003330030200231200112302201012013001200212201231201221001223033011203113333200111112031012012231020000012000201030201021200200200013321202230113320213111203002201223001221101013021230230200310321303213012030003110220200000310030201200200210201200012013020200230201011201220203220300213003101200200113210302012012031230000102 ; int i, j; NSScanner *itemScanner; NSString *stringWithMacLineBreaks; NSMutableString *item, *sequence, *tempSequence; NSMutableArray *linesArray; NSMutableDictionary *matrixDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *phylipDictionary = [NSMutableDictionary dictionary]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity:10]; j = 0; //Convert all line breaks to Mac line breaks (\r) stringWithMacLineBreaks = [self convertLineBreaksToMac:textFile]; //Isolate individual lines based on \r linesArray = (NSMutableArray*)[stringWithMacLineBreaks componentsSeparatedByString:@"\r"]; //Remove empty lines for (i = 0; i < [linesArray count]; i++) { NSString *string = [linesArray objectAtIndex:i]; if ((![string stringContainsOneSpace] && [string length] < 20) || [string isEqualToString:@""] || [string stringBeginsWithTwoNumbers] || [string stringContainsHyphen]) { [linesArray removeObjectAtIndex:i]; i--; } } //Read item names and sequences and put them in the matrixDictionary. for (i = 0; i < [linesArray count]; i++) { if ([[linesArray objectAtIndex:i] hasPrefix:@" "]) { //If the item name is not present sequence = [linesArray objectAtIndex:i]; tempSequence = (NSMutableString*)[[matrixDictionary objectForKey:[itemArray objectAtIndex:j]] stringByAppendingString:sequence]; [matrixDictionary setObject:tempSequence forKey:[itemArray objectAtIndex:j]]; j++; if (j == [itemArray count]) { j = 0;} } else { //If the item name precedes the sequence itemScanner = [[NSScanner alloc] initWithString:[linesArray objectAtIndex:i]]; [itemScanner scanUpToString:@" " intoString:&item]; sequence = (NSMutableString*)[[linesArray objectAtIndex:i]substringFromIndex:[itemScanner scanLocation]]; [matrixDictionary setObject:sequence forKey:item]; [itemArray addObject:item]; //NSLog(@"Adding item %@", item); [itemScanner release]; } } //Remove spaces and tabs from the sequences in the matrixDictionary for (i = 0; i < [itemArray count]; i++) { tempSequence = [NSMutableString stringWithString:[matrixDictionary objectForKey:[itemArray objectAtIndex:i]]]; [tempSequence replaceOccurrencesOfString:@" " withString:@"" options:(unsigned)NULL range:NSMakeRange(0, [tempSequence length])]; [tempSequence replaceOccurrencesOfString:@"\t" withString:@"" options:(unsigned)NULL range:NSMakeRange(0, [tempSequence length])]; [matrixDictionary setObject:tempSequence forKey:[itemArray objectAtIndex:i]]; } //Put the matrixDictionary and the items Array in the nonaDictionary [phylipDictionary setObject:matrixDictionary forKey:@"matrix"]; [phylipDictionary setObject:itemArray forKey:@"items"]; [phylipDictionary setObject:@"Hennig86" forKey:@"fileType"]; return phylipDictionary; } */ @end biococoa-2.2.2/BCFoundation/BCSequenceIO/BCSequenceWriter.h000644 000765 000024 00000003324 11223237412 023777 0ustar00scottcstaff000000 000000 // // BCSequenceWriter.h // BioCocoa // // Created by Koen van der Drift on 8/12/06. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import @class BCSequenceArray; @interface BCSequenceWriter : NSObject { } - (NSString *)writeFastaFile:(BCSequenceArray *)sequenceArray; @end biococoa-2.2.2/BCFoundation/BCSequenceIO/BCSequenceWriter.m000644 000765 000024 00000004527 11223237412 024012 0ustar00scottcstaff000000 000000 // // BCSequenceWriter.m // BioCocoa // // Created by Koen van der Drift on 8/12/06. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCSequenceWriter.h" #import "BCSequenceArray.h" #import "BCSequence.h" @implementation BCSequenceWriter - (NSString *)writeFastaFile:(BCSequenceArray *)sequenceArray { int i; BCSequence *aSequence; NSString *sequenceString; NSString *sequenceIdentifier; NSMutableString *result = [NSMutableString string]; [result setString: @""]; for (i = 0; i < [sequenceArray count]; i++) { aSequence = [sequenceArray sequenceAtIndex: i]; sequenceString = [aSequence sequenceString]; if ([aSequence annotations] != nil) { sequenceIdentifier = (NSString *) [aSequence annotationForKey: @">"]; [result appendString: @"> "]; [result appendString: sequenceIdentifier]; [result appendString: @"\r"]; } [result appendString: sequenceString]; } return result; } @end biococoa-2.2.2/BCFoundation/BCSequenceIO/GNUmakefile000644 000765 000024 00000004053 11226023231 022521 0ustar00scottcstaff000000 000000 # # GNUmakefile # # Written by: Scott Christley # Copyright (c) 2003-2009 The BioCocoa Project. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # include $(GNUSTEP_MAKEFILES)/common.make # The library to be compiled SUBPROJECT_NAME = BCSequenceIO # The Objective-C source files to be compiled BCSequenceIO_OBJC_FILES = \ BCSequenceReader.m \ BCSequenceWriter.m \ BCCachedSequenceFile.m \ BCCachedFastaFile.m # The header files BCSequenceIO_HEADER_FILES = \ BCSequenceReader.h \ BCSequenceWriter.h \ BCCachedSequenceFile.h \ BCCachedFastaFile.h BIOCOCOA_BASE_DIR = .. -include $(BIOCOCOA_BASE_DIR)/GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble biococoa-2.2.2/BCFoundation/BCSequence/BCAnnotation.h000644 000765 000024 00000024032 11370700423 022713 0ustar00scottcstaff000000 000000 // // BCAnnotation.h // BioCocoa // // Created by Alexander Griekspoor on 22/2/2005. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Provides sequence annotations. */ #import #import "BCFoundationDefines.h" // BCAnnotation Strings /*! @constant BCAnnotationIdentity @abstract Annotation Identity Property */ extern NSString * const BCAnnotationIdentity; /*! @constant BCAnnotationOrganism @abstract Annotation Organism Property */ extern NSString * const BCAnnotationOrganism; /*! @class BCAnnotation @abstract Represents a single annotation belonging to a sequence @discussion This class represents a non-positional annotation (in contrast to its subclass BCFeature which adds positional information). * BCAnnotation objects are held by the sequence object in a mutable dictionary with its name as the key. Each annotation object * has a name (as its identifier), and a content which can be of any class but must be an object. The name of the content class is * can be retrieved using the datatype method. These property names (name, content, datatype) adhere to the BSML standard of attributes. * Note that in principle it is possible to store arrays and dictionaries as content, which allows for nested annotations. Further * methods to support/organize annotation nesting/sets are necessary though, nesting is therefore not advised. */ @interface BCAnnotation : NSObject { NSString *name; // name or identifier of the annotation NSObject *content; // content, must be an object (plain c types must be converted to NSNumber) } #if 0 #pragma mark == INITIALIZATION METHODS == #endif /*! @method initWithName:content: @abstract initializes a BCAnnotation object by passing it a NSString (name) and content object. @discussion This is the designated initializer for BCAnnotation */ - (id)initWithName: (NSString *)aName content: (id)theContent; /*! @method initWithName:intValue: @abstract initializes a BCAnnotation object by passing it a NSString name and integer as content. @discussion This is method converts an integer in a NSNumber object and uses the designated initializer * to initialize a BCAnnotation object */ - (id)initWithName: (NSString *)aName intValue: (int)theContent; /*! @method initWithName:floatValue: @abstract initializes a BCAnnotation object by passing it a NSString name and float as content. @discussion This is method converts a float in a NSNumber object and uses the designated initializer * to initialize a BCAnnotation object */ - (id)initWithName: (NSString *)aName floatValue: (float)theContent; /*! @method initWithName:doubleValue: @abstract initializes a BCAnnotation object by passing it a NSString name and double as content. @discussion This is method converts a double in a NSNumber object and uses the designated initializer * to initialize a BCAnnotation object */ - (id)initWithName: (NSString *)aName doubleValue: (double)theContent; /*! @method initWithName:boolValue: @abstract initializes a BCAnnotation object by passing it a NSString name and boolean as content. @discussion This is method converts a boolean in a NSNumber object and uses the designated initializer * to initialize a BCAnnotation object */ - (id)initWithName: (NSString *)aName boolValue: (BOOL)theContent; /*! @method annotationWithName:content: @abstract creates and returns an autoreleased annotation object initialized with a NSString (name) and content object. */ + (id)annotationWithName: (NSString *)aName content: (id)theContent; /*! @method annotationWithName:intValue: @abstract creates and returns an autoreleased annotation object initialized with a NSString (name) and integer as content. @discussion This is method converts a integer in a NSNumber object */ + (id)annotationWithName: (NSString *)aName intValue: (int)theContent; /*! @method annotationWithName:floatValue: @abstract creates and returns an autoreleased annotation object initialized with a NSString (name) and float as content. @discussion This is method converts a float in a NSNumber object */ + (id)annotationWithName: (NSString *)aName floatValue: (float)theContent; /*! @method annotationWithName:doubleValue: @abstract creates and returns an autoreleased annotation object initialized with a NSString (name) and double as content. @discussion This is method converts a double in a NSNumber object */ + (id)annotationWithName: (NSString *)aName doubleValue: (double)theContent; /*! @method annotationWithName:boolValue: @abstract creates and returns an autoreleased annotation object initialized with a NSString (name) and boolean as content. @discussion This is method converts a boolean in a NSNumber object */ + (id)annotationWithName: (NSString *)aName boolValue: (BOOL)theContent; /*! @method copyWithZone: @abstract returns copy of the receiving annotation object. */ - (id)copyWithZone:(NSZone *)zone; #if 0 #pragma mark == ACCESSOR METHODS == #endif /*! @method name @abstract returns the name of the annotation */ - (NSString *)name; /*! @method setName: @abstract sets the name of the annotation */ - (void)setName:(NSString *)newName; /*! @method content @abstract returns the name of the content */ - (NSObject *)content; /*! @method setContent: @abstract sets the content of the annotation @discussion Note that this method retains the content object! */ - (void)setContent:(NSObject *)newContent; #if 0 #pragma mark == GENERAL METHODS == #endif /*! @method description @abstract returns the name, content, and datatype */ - (NSString *) description; /*! @method datatype @abstract returns the class name of the content object */ - (NSString *)datatype; /*! @method stringValue @abstract returns a string representation of the content object @discussion If the content object is not of class NSString this method returns the content object's description */ - (NSString *) stringValue; /*! @method intValue @abstract returns an integer representation of the content object @discussion This method tries to call intValue on the content object. Otherwise returns 0. */ - (int)intValue; /*! @method floatValue @abstract returns an float representation of the content object @discussion This method tries to call floatValue on the content object. Otherwise returns 0.0. */ - (float)floatValue; /*! @method doubleValue @abstract returns an double representation of the content object @discussion This method tries to call doubleValue on the content object. Otherwise returns 0.0. */ - (double)doubleValue; /*! @method boolValue @abstract returns an bool representation of the content object @discussion This method tries to call boolValue on the content object. Otherwise returns NO. */ - (BOOL)boolValue; #if 0 #pragma mark == COMPARISON & SORTING METHODS == #endif /*! @method isEqualTo: @abstract Compares the receiving annotation to otherAnnotation. @discussion If the NAME of otherAnnotation is equal to that of the receiver, this method returns YES. If not, it returns NO. */ - (BOOL)isEqualTo: (BCAnnotation *) otherAnnotation; /*! @method isEqualToAnnotation: @abstract Compares the content of the receiving annotation to otherAnnotation. @discussion If the CONTENT of otherAnnotation is equal to that of the receiver, this method returns YES. If not, it returns NO. * Note that the names of both annotations do not necessarily have to be identical. */ - (BOOL)isEqualToAnnotation: (BCAnnotation *) otherAnnotation; /*! @method sortAnnotationsOnNameAscending: @abstract Sorts the receiving annotations compared to otherAnnotation based on name in ascending order. */ - (NSComparisonResult)sortAnnotationsOnNameAscending:(BCAnnotation *) ann; /*! @method sortAnnotationsOnNameDescending: @abstract Sorts the receiving annotations compared to otherAnnotation based on name in descending order. */ - (NSComparisonResult)sortAnnotationsOnNameDescending:(BCAnnotation *) ann; /*! @method sortAnnotationsOnContentAscending: @abstract Sorts the receiving annotations compared to otherAnnotation based on content in ascending order. @discussion If both contents are of class NSString OR NSNumber calls compare: else returns NSOrderedSame */ - (NSComparisonResult)sortAnnotationsOnContentAscending:(BCAnnotation *) ann; /*! @method sortAnnotationsOnContentDescending: @abstract Sorts the receiving annotations compared to otherAnnotation based on content in descending order. @discussion If both contents are of class NSString OR NSNumber calls compare: else returns NSOrderedSame */ - (NSComparisonResult)sortAnnotationsOnContentDescending:(BCAnnotation *) ann; @end biococoa-2.2.2/BCFoundation/BCSequence/BCAnnotation.m000644 000765 000024 00000020064 11370700423 022721 0ustar00scottcstaff000000 000000 // // BCAnnotation.m // BioCocoa // // Created by Alexander Griekspoor on 22/2/2005. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCAnnotation.h" #import "BCInternal.h" // BCAnnotation Strings NSString * const BCAnnotationIdentity = @"identity"; NSString * const BCAnnotationOrganism = @"organism"; @implementation BCAnnotation #if 0 #pragma mark == INITIALIZATION METHODS == #endif - (id)initWithName: (NSString *)aName content: (id)theContent{ if ( (self = [super init]) ) { [self setName: aName]; [self setContent: theContent]; } return self; } - (id)initWithName: (NSString *)aName intValue: (int)theContent{ return [self initWithName: aName content: [NSNumber numberWithInt:theContent]]; } - (id)initWithName: (NSString *)aName floatValue: (float)theContent{ return [self initWithName: aName content: [NSNumber numberWithFloat:theContent]]; } - (id)initWithName: (NSString *)aName doubleValue: (double)theContent{ return [self initWithName: aName content: [NSNumber numberWithDouble:theContent]]; } - (id)initWithName: (NSString *)aName boolValue: (BOOL)theContent{ return [self initWithName: aName content: [NSNumber numberWithBool:theContent]]; } + (id)annotationWithName: (NSString *)aName content: (id)theContent{ return [[[[self class] alloc] initWithName: aName content: theContent] autorelease]; } + (id)annotationWithName: (NSString *)aName intValue: (int)theContent{ return [[[[self class] alloc] initWithName: aName intValue: theContent] autorelease]; } + (id)annotationWithName: (NSString *)aName floatValue: (float)theContent{ return [[[[self class] alloc] initWithName: aName floatValue: theContent] autorelease]; } + (id)annotationWithName: (NSString *)aName doubleValue: (double)theContent{ return [[[[self class] alloc] initWithName: aName doubleValue: theContent] autorelease]; } + (id)annotationWithName: (NSString *)aName boolValue: (BOOL)theContent{ return [[[[self class] alloc] initWithName: aName boolValue: theContent] autorelease]; } - (id)copyWithZone:(NSZone *)zone{ BCAnnotation *copy = [[BCAnnotation allocWithZone: zone] initWithName: [self name] content: [self content]]; return copy; } - (void)dealloc{ [name release]; [content release]; [super dealloc]; } #if 0 #pragma mark == ACCESSOR METHODS == #endif - (NSString *)name{ return name; } - (void)setName:(NSString *)newName{ [newName retain]; [name release]; name = newName; } - (NSObject *)content { return content; } - (void)setContent:(NSObject *)newContent { [newContent retain]; [content release]; content = newContent; } #if 0 #pragma mark == GENERAL METHODS == #endif - (NSString *) description{ return [NSString stringWithFormat: @"%@ - %@ (%@)", [self name], [self content], [self datatype]]; } - (NSString *)datatype{ return [[self content]className]; } - (NSString *) stringValue{ if([[self content]isKindOfClass: [NSString class]]) return (NSString *)[self content]; else return [content description]; } - (int)intValue{ // Set default value int val = 0; // Check if content supports intValue method NSMethodSignature *sig = [[[self content]class] instanceMethodSignatureForSelector: @selector(intValue)]; if(sig){ // Create invocation to get integer (must go through invocation if return type is of normal c type) NSInvocation* invocation = [NSInvocation invocationWithMethodSignature: sig]; [invocation setSelector: @selector(intValue)]; [invocation invokeWithTarget: [self content]]; // Get return value of invocation into val [invocation getReturnValue: &val]; } return val; } - (float)floatValue{ float val = 0.0; NSMethodSignature *sig = [[[self content]class] instanceMethodSignatureForSelector: @selector(floatValue)]; if(sig){ NSInvocation* invocation = [NSInvocation invocationWithMethodSignature: sig]; [invocation setSelector: @selector(floatValue)]; [invocation invokeWithTarget: [self content]]; [invocation getReturnValue: &val]; } return val; } - (double)doubleValue{ double val = 0.0; NSMethodSignature *sig = [[[self content]class] instanceMethodSignatureForSelector: @selector(doubleValue)]; if(sig){ NSInvocation* invocation = [NSInvocation invocationWithMethodSignature: sig]; [invocation setSelector: @selector(doubleValue)]; [invocation invokeWithTarget: [self content]]; [invocation getReturnValue: &val]; } return val; } - (BOOL)boolValue{ BOOL val = NO; NSMethodSignature *sig = [[[self content]class] instanceMethodSignatureForSelector: @selector(boolValue)]; if(sig){ NSInvocation* invocation = [NSInvocation invocationWithMethodSignature: sig]; [invocation setSelector: @selector(boolValue)]; [invocation invokeWithTarget: [self content]]; [invocation getReturnValue: &val]; } return val; } #if 0 #pragma mark == COMPARISON & SORTING METHODS == #endif - (BOOL)isEqualTo: (BCAnnotation *) otherAnnotation{ return [[self name] isEqualToString: [otherAnnotation name]]; } - (BOOL)isEqualToAnnotation: (BCAnnotation *) otherAnnotation{ return [[self content] isEqualTo: [otherAnnotation content]]; } - (NSComparisonResult)sortAnnotationsOnNameAscending:(BCAnnotation *) ann{ return [[self name] compare: [ann name]]; } - (NSComparisonResult)sortAnnotationsOnNameDescending:(BCAnnotation *) ann{ return [[ann name] compare: [self name]]; } - (NSComparisonResult)sortAnnotationsOnContentAscending:(BCAnnotation *) ann{ NSComparisonResult val = NSOrderedSame; // Are both contents of the same class? if([[self content] isKindOfClass: [[ann content]class]]){ // Do they respond to compare:? NSMethodSignature *sig = [[[self content]class] instanceMethodSignatureForSelector: @selector(compare:)]; if(sig){ id cont = [ann content]; // Invoke compare and get return value NSInvocation* invocation = [NSInvocation invocationWithMethodSignature: sig]; [invocation setSelector: @selector(compare:)]; [invocation setArgument: &cont atIndex: 2]; [invocation invokeWithTarget: [self content]]; [invocation getReturnValue: &val]; } } return val; } - (NSComparisonResult)sortAnnotationsOnContentDescending:(BCAnnotation *) ann{ NSComparisonResult val = NSOrderedSame; // Are both contents of the same class? if([[self content] isKindOfClass: [[ann content]class]]){ // Do they respond to compare:? NSMethodSignature *sig = [[[ann content]class] instanceMethodSignatureForSelector: @selector(compare:)]; if(sig){ // Invoke compare and get return value NSInvocation* invocation = [NSInvocation invocationWithMethodSignature: sig]; [invocation setSelector: @selector(compare:)]; [invocation setArgument: &content atIndex: 2]; [invocation invokeWithTarget: [ann content]]; [invocation getReturnValue: &val]; } } return val; } @end biococoa-2.2.2/BCFoundation/BCSequence/BCSequence.h000644 000765 000024 00000037357 11223237412 022367 0ustar00scottcstaff000000 000000 // // BCSequence.h // BioCocoa // // Created by Koen van der Drift on 12/14/2004. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Provides in-memory representations of biological sequence (DNA, protein, etc.). */ #import #import "BCFoundationDefines.h" @class BCSymbol; @class BCSymbolSet; @class BCAnnotation; /*! @class BCSequence @abstract Class that holds a biological sequence (DNA, protein, etc.) @discussion This class is used for all types of sequences. The sequence type * is determined by the symbolset, which defines the BCSymbols that are allowed * to be in the sequence. Compare this to NSString, where the encoding determines the * type of string that is inside the NSString object. */ @interface BCSequence : NSObject { NSData *sequenceData; // holds a char array with the sequence string BCSymbolSet *symbolSet; // determines the BCSymbols that can be in this sequence NSArray *symbolArray; // array of BCSymbol objects to represent the sequence NSMutableDictionary *annotations; // annotations fot this sequence BCSequenceType sequenceType; // defines the sequence type } #if 0 #pragma mark == INITIALIZATION METHODS == #endif /*! @method initWithSymbolArray:symbolSet: @abstract initializes a BCSequence object by passing it an NSArray of BCSymbol. @discussion * The method scans the passed array for all BCSymbol objects, and creates * a new BCSequence using them. The symbol set is used to filter the passed symbols. * The symbol set instance should be the same sequence type as the sequence, e.g. should * contain DNA symbols if used to initialize a DNA sequence. If not the right sequence type, * or if the symbolSet is nil, then the implementation guesses the most likely * symbolSet based on the symbols in the array. */ - (id)initWithSymbolArray:(NSArray *)anArray symbolSet:(BCSymbolSet *)aSet; /*! @method initWithData:symbolSet: @abstract initializes a BCSequence object by passing it an NSData of symbols. @discussion * The method scans the passed data for all BCSymbol objects, and creates * a new BCSequence using them. The symbol set is used to filter the passed symbols. * The symbol set instance should be the same sequence type as the sequence, e.g. should * contain DNA symbols if used to initialize a DNA sequence. If not the right sequence type, * or if the symbolSet is nil, then the implementation guesses the most likely * symbolSet based on the symbols in the array. */ - (id)initWithData:(NSData *)aData symbolSet:(BCSymbolSet *)aSet; /*! @method initWithSymbolArray: @abstract initializes a BCSequence object by passing it an NSArray of BCSymbol. @discussion This method calls '-initWithSymbolArray:symbolSet' * using the default symbol set for the class. * The method scans the passed array for all BCSymbol objects compatible with the * type of sequence being created. */ - (id)initWithSymbolArray:(NSArray *)anArray; /*! @method initWithString:symbolSet: @abstract initializes a BCSequence object by passing it an NSString. @discussion This is the designated initializer. * This method will attempt to create an array of BCSymbols using the * characters found in the string. * The BCSymbols created will depend on the symbol set passed as argument. */ - (id)initWithString:(NSString *)aString symbolSet:(BCSymbolSet *)aSet; /*! @method initWithString: @abstract initializes a BCSequence object by passing it an NSString. @discussion This method calls initWithString:symbolSet: * using the default symbol set of the class as argument. * The method should only be called on a concrete subclass. * This method will create an array of BCSymbols using the * characters found in the string. The type of BCSymbols created * will depend on the the sequence type, e.g. a DNA sequence * will only use DNA bases. */ - (id)initWithString:(NSString*)aString; /*! @method initWithString:range: @abstract initializes a BCSequence object by passing it an NSString and a range. @discussion This method calls '-initWithString:'. Note that the range is 0-based. */ - (id)initWithString:(NSString*)aString range:(NSRange)aRange; /*! @method initWithString:symbolSet: @abstract initializes sequence object with the string passed as argument @discussion This method calls 'initWithString:symbolSet:'. */ - (id)initWithString:(NSString*)aString range:(NSRange)aRange symbolSet:(BCSymbolSet *)aSet; /*! @method initWithThreeLetterString:symbolSet: @abstract initializes sequence object with a three-letter code string passed as argument */ - (id)initWithThreeLetterString:(NSString*)aString symbolSet:(BCSymbolSet *)aSet; /*! @method sequenceWithString: @abstract creates and returns an autoreleased sequence object initialized with the string passed as argument @discussion This method calls 'initWithString:' */ + (BCSequence *)sequenceWithString:(NSString *)aString; /*! @method sequenceWithString:symbolSet: @abstract creates and returns an autoreleased sequence object initialized with the string passed as argument @discussion This method calls 'initWithString:symbolSet:'. */ + (BCSequence *)sequenceWithString:(NSString *)aString symbolSet:(BCSymbolSet *)aSet; /*! @method sequenceWithThreeLetterString:symbolSet: @abstract creates and returns an autoreleased sequence object initialized with a three-letter code string passed as argument @discussion This method calls 'initWithString:symbolSet:'. */ + (BCSequence *)sequenceWithThreeLetterString:(NSString *)aString symbolSet:(BCSymbolSet *)aSet; /*! @method sequenceWithSymbolArray: @abstract creates and returns an autoreleased sequence object initialized with the array of BCSymbols passed as argument @discussion This method calls 'initWithSymbolArray:' */ + (BCSequence *)sequenceWithSymbolArray:(NSArray *)entry; /*! @method sequenceWithSymbolArray: @abstract creates and returns an autoreleased sequence object initialized with the array of BCSymbols passed as argument @discussion This method calls 'initWithSymbolArray:symbolSet' */ + (BCSequence *)sequenceWithSymbolArray:(NSArray *)entry symbolSet: (BCSymbolSet *)aSet; /*! @method objectForSavedRepresentation: @abstract Returns a BCSequence object representing the sequence submitted @discussion all BC classes should implement a "savableRepresentation" and an * "objectForSavedRepresentation" method to allow archiving/uncarchiving in * .plist formatted files. */ + (BCSequence *)objectForSavedRepresentation:(NSString *)sequence; /*! @method convertThreeLetterStringToOneLetterString:symbolSet: @abstract Converts a 3-letter code string to a 1-letter code string */ - (NSString *)convertThreeLetterStringToOneLetterString:(NSString *)aString symbolSet: (BCSymbolSet *)aSet; #if 0 #pragma mark == SEQUENCE TYPE DETERMINATION == #endif /*! @method sequenceTypeForString: @abstract Returns the guessed sequence type of an arbitrary string. */ - (BCSequenceType)sequenceTypeForString:(NSString *)string; /*! @method sequenceTypeForData: @abstract Returns the guessed sequence type from sequence data. */ - (BCSequenceType)sequenceTypeForData:(NSData *)aData; /*! @method sequenceTypeForSymbolArray: @abstract Returns the guessed sequence type of an array of BCSymbols. */ - (BCSequenceType)sequenceTypeForSymbolArray:(NSArray *)anArray; #if 0 #pragma mark == OBTAINING SEQUENCE INFORMATION == #endif /*! @method sequenceData @abstract returns and NSData object containing the sequenceData */ - (NSData *) sequenceData; /*! @method bytes; @abstract returns the raw bytes representing the sequence */ - (const unsigned char *) bytes; /*! @method symbolSet @abstract returns the symbolSet associated with this sequence */ - (BCSymbolSet *) symbolSet; /*! @method setSymbolSet: @abstract sets the symbolSet associated with this sequence */ - (void) setSymbolSet:(BCSymbolSet *)symbolSet; /*! @method sequenceType @abstract returns the type of sequence */ - (BCSequenceType) sequenceType; /*! @method length @abstract returns the length of the sequence */ - (unsigned int) length; /*! @method symbolAtIndex: @abstract returns the BCSymbol object at index. Returns nil if index is out of bounds. */ - (BCSymbol *)symbolAtIndex: (int)theIndex; /*! @method containsAmbiguousSymbols @abstract determines whether any symbols in the sequence are compound symbols. */ - (BOOL) containsAmbiguousSymbols; /*! @method sequenceString @abstract returns the sequence string of the object. @discussion returns an NSString containing a one letter-code string of the sequence. * This method is useful when the sequence needs to be displayed in a view. */ - (NSString*)sequenceString; /*! @method symbolArray @abstract returns a ponter to the array of BCSymbol objects that make up the sequence. @discussion The array returned is the object used internally by BCSequence. * The array obtained should only be used for reading, and should not be modified by the caller. * To modify the sequence, instead use one of the * convenience methods setSymbolArray, removeSymbolsInRange, removeSymbolsAtIndex, * or insertSymbolsFromSequence:atIndex. */ - (NSArray *)symbolArray; /*! @method clearSymbolArray @abstract clears the symbol array @discussion Removes all symbols from the symbol array and sets the array to nil. * Call this method first to re-generate the symbolArray after the sequence has been modified. */ - (void)clearSymbolArray; /*! @method subSequenceStringInRange: @abstract returns a subsequence in string form @discussion returns an NSString containing a subsequence specified by aRange (0-based). * Returns nil if any part of aRange is out of bounds. */ - (NSString *)subSequenceStringInRange:(NSRange)aRange; /*! @method sequenceStringFromSymbolArray: @abstract returns an NSString representation of a symbolArray */ - (NSString *)sequenceStringFromSymbolArray:(NSArray *)anArray; /*! @method subSymbolArrayInRange: @abstract returns a sub-symbolarray form @discussion returns an NSArray containing a subsequence specified by aRange (0-based). * Returns nil if any part of aRange is out of bounds. */ - (NSArray *)subSymbolArrayInRange:(NSRange)aRange; /*! @method subSequenceInRange: @abstract returns a sub-symbollist @discussion returns an BCSequence containing a sub-symbollist specified by aRange (0-based). * Returns nil if any part of aRange is out of bounds. */ - (BCSequence *)subSequenceInRange:(NSRange)aRange; /*! @method savableRepresentation @abstract Returns the sequenceString for saving. @discussion All BCSymbol classes implement this method to provide a standard way of * accessing their data in a format that can be stored in Apple .plist files within * arrays or dictionaries. */ - (NSString *) savableRepresentation; /*! @method description @abstract Overrides NSObject's description - describes the object in string form @discussion In the default implementation, returns the sequence string. Useful primarily * for debugging. */ - (NSString *) description; /*! @method addAnnotation: @abstract Add a BCAnnotation object to the annotations dictionary */ - (void) addAnnotation:(BCAnnotation *)annotation; /*! @method addAnnotation:forKey: @abstract Add an annotation to the annotations dictionary @discussion Using two strings for the key and value, this method adds an annotation */ - (void) addAnnotation:(NSString *)annotation forKey: (NSString *) key; /*! @method annotationForKey: @abstract Get the annpotation for a specific key @discussion Returns the annotation for a given key, which is passed as an NSString */ - (id) annotationForKey: (NSString *) key; /*! @method annotations @abstract Returns the annotations dictionary */ - (NSMutableDictionary *) annotations; /*! @method setAnnotations: @abstract Set the annotations dictionary @discussion This will completely replace the current annotations dictaionry. All key-value pairs will be lost * and replaced by those in the new dictionary. */ //- (void)setAnnotations:(NSMutableDictionary *)aDict; #if 0 #pragma mark == MANIPULATING THE SEQUENCE == #endif /*! @method setSymbolArray: @abstract sets the symbollist as an array of BCSymbol objects. */ - (void)setSymbolArray:(NSArray *)anArray; /*! @method removeSymbolsInRange: @abstract deletes a sub-symbollist. @discussion deletes the BCSymbols in the sub-symbollist specified by aRange (0-based). */ - (void)removeSymbolsInRange:(NSRange)aRange; /*! @method removeSymbolAtIndex: @abstract deletes one symbol. @discussion deletes a BCSymbol located at index (0-based). */ - (void)removeSymbolAtIndex:(int)index; /*! @method insertSymbolsFromSequence:atIndex: @abstract inserts a BCSequence into the current symbolarray, starting at index (0-based) @discussion inserts the BCSequence that is in the first argument in the current BCSequence. */ - (void)insertSymbolsFromSequence:(BCSequence *)seq atIndex:(int)index; #if 0 #pragma mark == DERIVING RELATED SEQUENCES == #endif /*! @method reverse @abstract returns a BCSequence that is the reverse of the one queried. */ - (BCSequence *) reverse; /*! @method complement @abstract returns a BCSequence that is the complement of the one queried. @discussion This is a convenience method that calls BCToolComplement. */ - (BCSequence *) complement; /*! @method reverseComplement @abstract returns a BCSequence that is the reverse complement of the one queried. @discussion This is a convenience method that calls BCToolComplement. */ - (BCSequence *) reverseComplement; #if 0 #pragma mark == FINDING SUBSEQUENCES == #endif - (NSArray *) findSequence: (BCSequence *) entry; - (NSArray *) findSequence: (BCSequence *) entry usingStrict: (BOOL) strict; - (NSArray *) findSequence: (BCSequence *) entry usingStrict: (BOOL) strict firstOnly: (BOOL) firstOnly; - (NSArray *) findSequence: (BCSequence *) entry usingStrict: (BOOL) strict firstOnly: (BOOL) firstOnly usingSearchRange: (NSRange) range; @end biococoa-2.2.2/BCFoundation/BCSequence/BCSequence.m000644 000765 000024 00000054215 11223237412 022364 0ustar00scottcstaff000000 000000 // // BCSequence.m // BioCocoa // // Created by Koen van der Drift on 12/14/2004. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCSequence.h" #import "BCAnnotation.h" #import "BCFoundationDefines.h" #import "BCSymbol.h" #import "BCAminoAcid.h" #import "BCSymbolSet.h" #import "BCToolSequenceFinder.h" #import "BCToolComplement.h" #import "BCUtilData.h" #import "BCInternal.h" @implementation BCSequence // TODO: // MOVE MUTABLE METHODS TO ... // UPDATE THE REVERSE METHOD - SHOULD THIS BE DONE STRING-BASED? // UPDATE MORE HEADERDOC INFORMATION // LOOK AGAIN AT SYMBOLATINDEX METHOD // ADD METHODS FOR NSDATA <-> NSSTRING CONVERSIONS, PROBABLY NOT IN THIS CLASS // FIX COMPILER WARNINGS // .... //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark INITIALIZATION METHODS #endif // // INITIALIZATION METHODS //////////////////////////////////////////////////////////////////////////// // designated initializer - (id)initWithString:(NSString *)aString symbolSet:(BCSymbolSet *)aSet { if ( (self = [super init]) ) { if ( aString != nil ) { if ( aSet == nil ) { aSet = [BCSymbolSet symbolSetForSequenceType: [self sequenceTypeForString: aString]]; } //let the set check the chars NSString *finalString = [aSet stringByRemovingUnknownCharsFromString: aString]; // fill the NSData buffer with the contents of the NSString sequenceData = [[finalString dataUsingEncoding: NSUTF8StringEncoding] retain]; } else { sequenceData = nil; } symbolSet = [aSet retain]; sequenceType = [aSet sequenceType]; annotations = nil; symbolArray = nil; } return self; } - (id)initWithData:(NSData *)aData symbolSet:(BCSymbolSet *)aSet { if ( (self = [super init]) ) { if ( aData != nil ) { if ( aSet == nil ) { aSet = [BCSymbolSet symbolSetForSequenceType: [self sequenceTypeForData: aData]]; } // let the set check the chars sequenceData = [aSet dataByRemovingUnknownCharsFromData: aData]; [sequenceData retain]; } else { sequenceData = nil; } symbolSet = [aSet retain]; sequenceType = [aSet sequenceType]; annotations = nil; symbolArray = nil; } return self; } - (id)initWithSymbolArray:(NSArray *)anArray symbolSet:(BCSymbolSet *)aSet { if ( (self = [super init]) ) { if ( aSet==nil ) { aSet = [BCSymbolSet symbolSetForSequenceType: [self sequenceTypeForSymbolArray: anArray]]; } //let the set check the symbols NSArray *finalArray=[aSet arrayByRemovingUnknownSymbolsFromArray:anArray]; symbolArray=[[NSMutableArray alloc] initWithArray:finalArray]; // fill the NSData buffer with the contents of the array of symbols sequenceData = [[[self sequenceStringFromSymbolArray: symbolArray] dataUsingEncoding: NSUTF8StringEncoding] retain]; symbolSet=[aSet retain]; annotations=nil; sequenceType = [symbolSet sequenceType]; } return self; } - (id)initWithSymbolArray:(NSArray *)anArray { return [self initWithSymbolArray:anArray symbolSet: nil]; } // returns an empty sequence by calling the designated initializer - (id)init { return [self initWithString:[NSString string] symbolSet:[BCSymbolSet unknownSymbolSet]]; } - (id)initWithString:(NSString*)aString { return [self initWithString:aString symbolSet: nil]; } - (id)initWithString:(NSString*)aString range:(NSRange)aRange { return [self initWithString:[aString substringWithRange:aRange]]; } - (id)initWithString:(NSString*)aString range:(NSRange)aRange symbolSet:(BCSymbolSet *)aSet { return [self initWithString:[aString substringWithRange:aRange] symbolSet: aSet]; } - (id)initWithThreeLetterString:(NSString*)aString symbolSet:(BCSymbolSet *)aSet { return [self initWithString: [self convertThreeLetterStringToOneLetterString: aString symbolSet: aSet] symbolSet: aSet]; } + (BCSequence *)sequenceWithString: (NSString *)aString { return [[[BCSequence alloc] initWithString:aString] autorelease]; } + (BCSequence *)sequenceWithString:(NSString *)aString symbolSet:(BCSymbolSet *)aSet { return [[[BCSequence alloc] initWithString:aString symbolSet:aSet] autorelease]; } + (BCSequence *)sequenceWithThreeLetterString:(NSString *)aString symbolSet:(BCSymbolSet *)aSet { return [[[BCSequence alloc] initWithThreeLetterString: aString symbolSet:aSet] autorelease]; } + (BCSequence *)sequenceWithSymbolArray:(NSArray *)entry { return [[[BCSequence alloc] initWithSymbolArray:entry] autorelease]; } + (BCSequence *)sequenceWithSymbolArray:(NSArray *)entry symbolSet: (BCSymbolSet *)aSet; { return [[[BCSequence alloc] initWithSymbolArray:entry symbolSet: aSet] autorelease]; } + (BCSequence *) objectForSavedRepresentation: (NSString *)aSequence { return [[[BCSequence alloc] initWithString: aSequence] autorelease]; } - (NSString *)convertThreeLetterStringToOneLetterString:(NSString *)aString symbolSet: (BCSymbolSet *)aSet { int i; NSArray *anArray = [aString componentsSeparatedByString:@" "]; NSString *oneLetterCode, *threeLetterCode; NSMutableString *convertedString = [[NSMutableString alloc] initWithString: @""]; // build a temporary dictionary with the one-letter code as objects and the three-letter code as keys // the easiest seems to use a symbolset and iterate over all the symbols // for now only works for amino acids. However, if 3-letter codes are also available // for nucleotides, the code can be extended to use BCSymbol. That means that the ivar threeLetterCode // should be moved to BCSymbol from BCAminoAcid NSArray *symArray = [[BCSymbolSet proteinSymbolSet] allSymbols]; BCAminoAcid *symbol; NSMutableDictionary *symbolDict = [NSMutableDictionary dictionaryWithCapacity: [symArray count]]; for (i = 0; i < [symArray count]; i++) { symbol = [symArray objectAtIndex: i]; [symbolDict setObject: [symbol symbolString] forKey: [symbol threeLetterCode]]; } // now we have the temp symbolDict, iterate over the sequence (in 3-letter code) // and create a new string using the 1-letter code for (i = 0; i < [anArray count]; i++) { threeLetterCode = [anArray objectAtIndex: i]; oneLetterCode = [symbolDict objectForKey: [threeLetterCode capitalizedString]]; if ( oneLetterCode ) { [convertedString appendString: oneLetterCode]; } } return [convertedString autorelease]; } // BCSequence is immutable, no need to copy anything just retain and return self - (id)copyWithZone:(NSZone *)zone { return [self retain]; } - (void)dealloc { [sequenceData release]; [symbolSet release]; [annotations release]; [self clearSymbolArray]; [super dealloc]; } //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark SEQUENCE TYPE DETERMINATION #endif // // INFORMATIONAL METHODS //////////////////////////////////////////////////////////////////////////// // This method guesses the sequence type based on a string. // The method creates new sequences of the different types // and checks which one results in the longer sequence, // which is also the one having the lowest number of unknown symbols. - (BCSequenceType)sequenceTypeForString:(NSString *)string { // bestSequenceType = best sequence type so far // bestSymbolCount = the length of the best sequence type so far BCSequence *testSequence; BCSequenceType bestSequenceType; unsigned int bestSymbolCount; // use a DNA sequence to initialize the values of bestSequenceType and bestSymbolCount testSequence=[BCSequence sequenceWithString:string symbolSet: [BCSymbolSet dnaSymbolSet]]; bestSequenceType=BCSequenceTypeDNA; bestSymbolCount=[testSequence length]; // test RNA sequence testSequence=[BCSequence sequenceWithString:string symbolSet: [BCSymbolSet rnaSymbolSet]]; if ([testSequence length]>bestSymbolCount) { bestSequenceType=BCSequenceTypeRNA; bestSymbolCount=[testSequence length]; } // test Protein sequence testSequence=[BCSequence sequenceWithString:string symbolSet: [BCSymbolSet proteinSymbolSet]]; if ([testSequence length]>bestSymbolCount) { bestSequenceType=BCSequenceTypeProtein; bestSymbolCount=[testSequence length]; } //TO DO: is it a BCSequenceCodon? // * symbols = DNA or RNA > protein // * length = multiple of three // * first 3 letters = ATG / AUG // * no stop codon, except at the end return bestSequenceType; } // This method guesses the sequence type for data - (BCSequenceType)sequenceTypeForData:(NSData *)aData { unsigned char *seqData = (unsigned char *)[aData bytes]; unsigned i, len = [aData length]; // hopefully can determine in first 10,000 symbols if (len > 10000) len = 10000; BCSymbolSet *dna = [BCSymbolSet dnaSymbolSet]; BCSymbolSet *rna = [BCSymbolSet rnaSymbolSet]; BCSymbolSet *prot = [BCSymbolSet proteinSymbolSet]; unsigned dnaCount = 0, rnaCount = 0, protCount = 0; // bestSequenceType = best sequence type so far // bestSymbolCount = the length of the best sequence type so far BCSequenceType bestSequenceType; // use a DNA sequence to initialize the values of bestSequenceType and bestSymbolCount for (i = 0; i < len; ++i) { if ([dna symbolForChar: seqData[i]]) ++dnaCount; if ([rna symbolForChar: seqData[i]]) ++rnaCount; if ([prot symbolForChar: seqData[i]]) ++protCount; } // Note that the DNA and RNA symbols is a subset of protein symbols // so assume DNA/RNA and only use protein if count is higher if (dnaCount > rnaCount) { if (protCount > dnaCount) { bestSequenceType = BCSequenceTypeProtein; } else { bestSequenceType = BCSequenceTypeDNA; } } else { if (protCount > rnaCount) { bestSequenceType = BCSequenceTypeProtein; } else { bestSequenceType = BCSequenceTypeRNA; } } //TO DO: is it a BCSequenceCodon? // * symbols = DNA or RNA > protein // * length = multiple of three // * first 3 letters = ATG / AUG // * no stop codon, except at the end return bestSequenceType; } // This method guesses the sequence type based on an NSArray of BCSymbol. // The method creates new sequences of the different types // and checks which one results in the longer sequence, // which is also the one having the lowest number of unknown symbols. - (BCSequenceType)sequenceTypeForSymbolArray:(NSArray *)anArray; { // bestSequenceType = best sequence type so far // bestSymbolCount = the length of the best sequence type so far BCSequence *testSequence; BCSequenceType bestSequenceType; unsigned int bestSymbolCount; // use DNA sequence to initialize the values of bestSequenceType and bestSymbolCount testSequence=[BCSequence sequenceWithSymbolArray:anArray symbolSet: [BCSymbolSet dnaSymbolSet]]; bestSequenceType=BCSequenceTypeDNA; bestSymbolCount=[testSequence length]; // test RNA sequence testSequence=[BCSequence sequenceWithSymbolArray:anArray symbolSet: [BCSymbolSet rnaSymbolSet]]; if ([testSequence length]>bestSymbolCount) { bestSequenceType=BCSequenceTypeRNA; bestSymbolCount=[testSequence length]; } // test protein sequence testSequence=[BCSequence sequenceWithSymbolArray:anArray symbolSet: [BCSymbolSet proteinSymbolSet]]; if ([testSequence length]>bestSymbolCount) { bestSequenceType=BCSequenceTypeProtein; bestSymbolCount=[testSequence length]; } //TO DO: is it a BCSequenceCodon? // * symbols = DNA or RNA > protein // * length = multiple of three // * first 3 letters = ATG / AUG // * no stop codon, except at the end return bestSequenceType; } //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark OBTAINING SEQUENCE INFORMATION #endif // // INFORMATIONAL METHODS //////////////////////////////////////////////////////////////////////////// - (NSData *) sequenceData { return sequenceData; } - (const unsigned char *) bytes { return (const unsigned char *)[[self sequenceData] bytes]; } - (BCSymbolSet *)symbolSet { return symbolSet; } // we can now allow to modify a symbolset, eg from strict -> non strict - (void)setSymbolSet:(BCSymbolSet *)set { [set retain]; [symbolSet release]; symbolSet = set; } - (BCSequenceType)sequenceType { return sequenceType; } // should this be commented out? /* - (void) setSequenceType:(BCSequenceType)aType { sequenceType = aType; } */ - (unsigned int) length { return [[self sequenceData] length]; } - (BCSymbol *)symbolAtIndex: (int)theIndex { if ( theIndex < [self length] ) { BCSymbol *aSymbol; #if 1 unsigned char c = [[self sequenceData] charAtIndex: theIndex]; aSymbol = [[self symbolSet] symbolForChar: c]; #else // or maybe use getBytes - not faster according to reply on CocoaDev-list unsigned char buffer; [[self sequenceData] getBytes: &buffer range: NSMakeRange( theIndex, 1 )]; aSymbol = [[self symbolSet] symbolForChar: buffer]; #endif return aSymbol; } return nil; } - (BOOL) containsAmbiguousSymbols { BCSymbol *aSymbol; DECLARE_INDEX(loopCounter); int theLimit = [symbolArray count]; for ( loopCounter = 0 ; loopCounter < theLimit ; loopCounter++ ) { aSymbol = (BCSymbol *)ARRAY_GET_VALUE_AT_INDEX(symbolArray, loopCounter); if ( [aSymbol isCompoundSymbol] ) return YES; } return NO; } - (NSArray *)symbolArray { if ( sequenceData == nil ) { return nil; } if ( symbolArray == nil ) { // creates a symbol array from the NSData sequence const unsigned char *data; unsigned int i, len; BCSymbol *aSymbol; data = [self bytes]; len = strlen((char *)data); NSMutableArray *anArray = [NSMutableArray array]; for (i = 0; i < len; i++) { if ( (aSymbol = [[self symbolSet] symbolForChar: data[i]]) ) { [anArray addObject: aSymbol]; } } symbolArray = [[NSArray alloc] initWithArray: anArray]; } return symbolArray; } - (void)clearSymbolArray { [symbolArray release]; symbolArray = nil; } // TO DO : use BCSymbolSet for filtering // DO WE STILL NEED THIS METHOD ?? - (void) setSymbolArray: (NSArray *) anArray { [symbolArray release]; symbolArray = [[NSMutableArray alloc] init]; id aSymbol; DECLARE_INDEX(loopCounter); int theLimit = [anArray count]; for ( loopCounter = 0 ; loopCounter < theLimit ; loopCounter++ ) { aSymbol = (id)ARRAY_GET_VALUE_AT_INDEX(anArray, loopCounter); ARRAY_APPEND_VALUE((NSMutableArray *)symbolArray, aSymbol); } } - (NSArray *)subSymbolArrayInRange:(NSRange)aRange { if ( aRange.location + aRange.length > [symbolArray count] ) return nil; return [symbolArray subarrayWithRange: aRange]; } - (NSString*)sequenceString { unsigned int length = [self length]; if ( length ) return [self subSequenceStringInRange: NSMakeRange( 0, length ) ]; else return @""; // return empty string, not nil. } - (NSString *)subSequenceStringInRange:(NSRange)aRange { if ( aRange.location + aRange.length > [self length] ) return nil; NSData *data = [[self sequenceData] subdataWithRange: aRange]; // Man, I love Cocoa !! NSString *theReturn = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding]; return theReturn; } - (NSString *)sequenceStringFromSymbolArray:(NSArray *)anArray { NSMutableString *symbols = [NSMutableString string]; BCSymbol *symbol; int i; for ( i = 0; i < [anArray count]; i++) { symbol = [anArray objectAtIndex: i]; [symbols appendString: [symbol symbolString]]; } return symbols; } - (BCSequence *)subSequenceInRange:(NSRange)aRange { if ( aRange.location + aRange.length > [symbolArray count] ) return nil; return [BCSequence sequenceWithSymbolArray: [symbolArray subarrayWithRange: aRange]]; } - (NSString *) savableRepresentation { return [self sequenceString]; } - (NSString *) description { return [self sequenceString]; } - (void) addAnnotation:(BCAnnotation *)annotation { [self addAnnotation: (id)[annotation content] forKey: [annotation name]]; } - (void) addAnnotation:(NSString *)annotation forKey: (NSString *) key { NSMutableString *oldValue; BCAnnotation *oldAnnotation, *newAnnotation; if ( annotations == nil ) { annotations = [[NSMutableDictionary alloc] init]; } // If key already exists, then we need to append the value, instead of replacing it. // This will happen when annotations are in the entry in multiple lanes. oldAnnotation = (BCAnnotation *) [[self annotations] valueForKey: key]; if ( oldAnnotation ) { oldValue = [[oldAnnotation content] mutableCopy]; [oldValue appendString: @"\n"]; [oldValue appendString: annotation]; newAnnotation = [[BCAnnotation alloc] initWithName: key content: oldValue]; } else { newAnnotation = [[BCAnnotation alloc] initWithName: key content: annotation]; } [[self annotations] setObject: newAnnotation forKey: key]; } - (id) annotationForKey: (NSString *) key { return [[self annotations] objectForKey: key]; } - (NSMutableDictionary *) annotations { return annotations; } //- (void) setAnnotations:(NSMutableDictionary *)aDict //{ // [aDict retain]; // [annotations release]; // annotations=aDict; //} //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark DERIVING RELATED SEQUENCES #endif // DERIVING OTHER SEQUENCES //////////////////////////////////////////////////////////////////////////// - (BCSequence *) reverse { #if 1 NSMutableArray *theReverse = [NSMutableArray array]; BCSymbol *aSymbol; DECLARE_INDEX(loopCounter); int theLimit = [[self symbolArray] count]; // or use [self length] ??? for ( loopCounter = 0 ; loopCounter < theLimit ; loopCounter++ ) { aSymbol = (id)ARRAY_GET_VALUE_AT_INDEX(symbolArray, loopCounter); ARRAY_INSERT_VALUE_AT_INDEX(theReverse, 0, aSymbol); } return [BCSequence sequenceWithSymbolArray: theReverse symbolSet: [self symbolSet]]; #else NSMutableData *reverseSequence = [[NSMutableData alloc] initWithLength: [self length]]; const unsigned char *normal = [self bytes]; unsigned char *reverse = [reverseSequence mutableBytes]; unsigned int len = strlen( (char *)normal ); unsigned i, j; j = 0; for(i = len; i >= 0; --i) { reverse[j] = normal[i]; j++; } NSString *reverseString = [[NSString alloc] initWithData: reverseSequence encoding: NSUTF8StringEncoding]; return [[BCSequence alloc] initWithString: [reverseString autorelease] symbolSet: [self symbolSet]]; #endif } - (BCSequence *)complement { BCToolComplement *complementTool = [BCToolComplement complementToolWithSequence: self]; return [complementTool sequenceComplement]; } - (BCSequence *) reverseComplement { BCToolComplement *complementTool = [BCToolComplement complementToolWithSequence: self]; [complementTool setReverse: YES]; return [complementTool sequenceComplement]; } //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark MANIPULATING SEQUENCE CONTENTS #endif // // INFORMATIONAL METHODS //////////////////////////////////////////////////////////////////////////// // THIS SHOULD ALL GO INTO THE MUTABLE SEQUENCE CLASS - (void)removeSymbolsInRange:(NSRange)aRange { if ( aRange.location + aRange.length > [symbolArray count] ) return; // [symbolArray removeObjectsInRange: aRange]; } - (void)removeSymbolAtIndex:(int)index { if ( index > [symbolArray count] - 1 ) return; // [symbolArray removeObjectAtIndex:index]; } // TO DO : use BCSymbolSet for filtering // - (void)insertSymbolsFromSequence:(BCSequence *)entry atIndex:(int)index { if ( index > [symbolArray count] - 1 ) return; // [symbolArray replaceObjectsInRange:NSMakeRange(index,0) withObjectsFromArray:[entry symbolArray]]; } //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark FINDING SUBSEQUENCES #endif // FINDING SUBSEQUENCES //////////////////////////////////////////////////////////////////////////// - (NSArray *) findSequence: (BCSequence *) entry { return [self findSequence: entry usingStrict: NO]; } - (NSArray *) findSequence: (BCSequence *) entry usingStrict: (BOOL) strict { return [self findSequence: entry usingStrict: strict firstOnly: NO]; } - (NSArray *) findSequence: (BCSequence *) entry usingStrict: (BOOL) strict firstOnly: (BOOL) firstOnly { return [self findSequence: entry usingStrict: strict firstOnly: NO usingSearchRange: NSMakeRange(0, [self length])]; } - (NSArray *) findSequence: (BCSequence *) entry usingStrict: (BOOL) strict firstOnly: (BOOL) firstOnly usingSearchRange: (NSRange) range { BCToolSequenceFinder *sequenceFinder = [BCToolSequenceFinder sequenceFinderWithSequence: self]; [sequenceFinder setStrict: strict]; [sequenceFinder setFirstOnly: firstOnly]; [sequenceFinder setSearchRange: range]; return [sequenceFinder findSequence: entry]; } @end biococoa-2.2.2/BCFoundation/BCSequence/BCSequenceArray.h000644 000765 000024 00000003653 11223237412 023356 0ustar00scottcstaff000000 000000 // // BCSequenceArray.h // BioCocoa // // Created by Koen van der Drift on 10/9/2005. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import #import "BCSequence.h" @interface BCSequenceArray : NSObject { NSMutableArray *sequenceArray; // array of the sequences NSString *description; // text to describe the sequences } -(BCSequence *) sequenceAtIndex:(int)index; -(void) addSequence: (BCSequence *) aSequence; -(void) removeSequence: (BCSequence *) aSequence; -(int)count; @end biococoa-2.2.2/BCFoundation/BCSequence/BCSequenceArray.m000644 000765 000024 00000004334 11223237412 023360 0ustar00scottcstaff000000 000000 // // BCSequenceArray.m // BioCocoa // // Created by Koen van der Drift on 10/9/2005. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCSequenceArray.h" @implementation BCSequenceArray - (id)init { if ( (self = [super init]) ) { sequenceArray = [[NSMutableArray alloc] init]; } return self; } - (void) dealloc { [sequenceArray release]; [super dealloc]; } -(BCSequence *) sequenceAtIndex:(int)index { // need to do some checking... return [sequenceArray objectAtIndex: index]; } -(void) addSequence: (BCSequence *) aSequence { [sequenceArray addObject: aSequence]; } -(void) removeSequence: (BCSequence *) aSequence { // actually I am not sure how to implement this if a sequence is passed - maybe it should be removeSequenceAtIndex } - (int) count { return [sequenceArray count]; } @end biococoa-2.2.2/BCFoundation/BCSequence/BCSequenceCodon.h000644 000765 000024 00000020545 11223237412 023341 0ustar00scottcstaff000000 000000 // // BCSequenceCodon.h // BioCocoa // // Created by John Timmer on 9/17/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Provides in-memory representations of DNA or RNA based codons. */ #import #import "BCSequence.h" /*! @class BCSequenceCodon @abstract Wrapper for an ordered array of BCCodons, either DNA- or RNA-based @discussion A subclass of BCSequence, this class handles access to an ordered list * of BCCodons. In addition to the usual BCSequence objects, it contains references to the * genetic code used to generate the BCSequenceCodon, and the reading frame as a string * (ie - +1, -2). Typically, BCCodonSequences are not created directly, but via the BCUtilTranslator * class methods. */ @interface BCSequenceCodon : BCSequence { BCGeneticCodeName usedCode; NSString *readingFrame; } #if 0 #pragma mark == INITIALIZATION METHODS == #endif /*! @method initWithCodonArray:geneticCode:frame: @abstract Designated class initializer. Arguments should be self explanatory. @discussion This is the designated initializer: other initializers call this method. * The designated initializer is thus different from the superclass. * It calls the designated initializer for the superclass. */ - (id)initWithCodonArray:(NSArray *)anArray geneticCode: (BCGeneticCodeName)codeType frame: (NSString *)theFrame; /*! @method initWithString:skippingUnknownSymbols: @abstract initializes a BCSequenceCodon object by passing it an NSString. @discussion The implementation overrides the superclass. If skipFlag * is YES, any character that cannot be converted to a BCNucleotideDNA object is eliminated * from the final symbolArray. Otherwise, they are replaced by "undefined" symbols. * As codons cannot be easily represented as single characters, this method attempts to determine if * the sequence is likely to be RNA (no T's, U's present), and creates a BCSequenceRNA from it if so. If not, * it creates a BCSequence. Once a sequence is made, it sends it for translation, * and the returned codon array is sent to the designated initializer * 'initWithCodonArray:geneticCode:frame:' */ - (id)initWithString:(NSString *)aString skippingUnknownSymbols:(BOOL)skipFlag; ///*! // @method - (id)initWithSymbolArray:(NSArray *)anArray // @abstract initializes a BCSequenceCodon object by passing it an NSArray of BCSymbol. // @discussion The implementation overrides the superclass. // * This method scans the passed array for all BCSymbol objects, and creates // * a new BCSequence using them. Once a sequence is made, it sends it for translation, // * and the returned codon array is sent to the designated initializer // * 'initWithCodonArray:geneticCode:frame:' //*/ //- (id)initWithSymbolArray:(NSArray *)anArray; /*! @method initWithCodonArray: @abstract nitializes a BCSequenceCodon object by passing it an array of BCCodon objects @discussion Scans the provided array for BCSequenceCodons and adds them to the resulting sequence. * If the first codon is RNA, it will assume a BCUnversalCodeRNA origin, otherwise the DNA version. * The reading frame is assumed to be +1. */ - (id)initWithCodonArray:(NSArray *)anArray; /*! @method sequenceWithCodonArray: @abstract creates and returns an autoreleased BCSequenceCodon object initialized with the codon array passed as argument */ + (BCSequenceCodon *)sequenceWithCodonArray:(NSArray *)anArray; - (BCSequence *)translate; #if 0 #pragma mark == ORF/TRANSLATION METHODS == #endif /*! @method longestOpenReadingFrame @abstract returns the longest stretch of codons that don't code for a stop or undefined aa. */ - (NSRange) longestOpenReadingFrame; /*! @method longestOpenReadingFrameUsingStartCodon: @abstract returns the longest stretch of codons that starts with (codon) and doesn't contain a stop or undefined aa. @discussion the start codon argument can be provided as a single BCCodon or as an array of codons, for situations/sepcies * where there is more than one start codon. */ - (NSRange) longestOpenReadingFrameUsingStartCodon: (id)codon; /*! @method openReadingFramesLongerThanCutoff: @abstract returns all open reading frames longer than the supplied cutoff @discussion The return array contains NSValues, coding for NSRanges. if no open reading * frames are found, it will return an empty array. Note the BioCocoa provides a method * in BCUtilValueAdditions that allows the sorting of these values based on the range length. */ - (NSArray *) openReadingFramesLongerThanCutoff: (unsigned int)cutoff; /*! @method openReadingFramesLongerThanCutoff:usingStartCodon: @abstract behaves identically to "openReadingFramesLongerThanCutoff:", but requires a start codon to initiate the ORF */ - (NSArray *) openReadingFramesLongerThanCutoff: (unsigned int)cutoff usingStartCodon: (id)codon; /*! @method translationOfRange: @abstract provides a protein sequence code for by the sub-sequence of codons within theRange @discussion This method will terminate short of the end of theRange if a stop codon or an undefined codon * is encountered */ - (BCSequence *) translationOfRange: (NSRange) theRange; /*! @method translationOfRange:usingStartCodon: @abstract behaves identically to "translationOfRange:" but requires a start codon to initiate translation */ - (BCSequence *) translationOfRange: (NSRange) theRange usingStartCodon: (id)codon; /*! @method translationsLongerThanCutoff: @abstract provides an array of BCSequences encoded by the receiver which are longer than cutoff */ - (NSArray *) translationsLongerThanCutoff: (unsigned int)cutoff; /*! @method translationsLongerThanCutoff:usingStartCodon: @abstract behaves identically to "translationsLongerThanCutoff:", but requires a start codon to initiate translation */ - (NSArray *) translationsLongerThanCutoff: (unsigned int)cutoff usingStartCodon: (id)codon; #if 0 #pragma mark == BASIC INFO == #endif /*! @method usedCode @abstract returns the genetic code used to generate the codon sequence */ - (BCGeneticCodeName) usedCode; /*! @method readingFrame @abstract returns the reading frame ("+2", "-1", etc.) used to generate the codon sequence */ - (NSString *)readingFrame; /*! @method convertRangeToOriginalSequence: @abstract converts a range in the codon sequence to the equivalent range in the coding sequence @discussion in many cases, the ranges of locations in a codon sequence (ie - ORF locations) need to be * located in the coding sequence of DNA or RNA bases. This method should allow the ranges generated by * methods in this class to be converted to the equivalent ranges for use with BCSequence or RNA classes. * The method accounts for reading frame. */ - (NSRange) convertRangeToOriginalSequence: (NSRange)entry; @end biococoa-2.2.2/BCFoundation/BCSequence/BCSequenceCodon.m000644 000765 000024 00000034163 11223237412 023347 0ustar00scottcstaff000000 000000 // // BCSequenceCodon.m // BioCocoa // // Created by John Timmer on 9/17/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCSequenceCodon.h" //#import "BCNucleotideDNA.h" //#import "BCSequenceProtein.h" //#import "BCSequenceDNA.h" //#import "BCSequenceRNA.h" #import "BCSequence.h" #import "BCSymbolSet.h" #import "BCCodonRNA.h" #import "BCCodonDNA.h" #import "BCAminoAcid.h" #import "BCToolTranslator.h" //#import "BCFoundationDefines.h" #import "BCInternal.h" @implementation BCSequenceCodon //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark INITIALIZATION METHODS #endif // INITIALIZATION METHODS //////////////////////////////////////////////////////////////////////////// //designated initializer - (id)initWithCodonArray:(NSArray *)anArray geneticCode: (BCGeneticCodeName)codeType frame: (NSString *)theFrame { if ( (self = [super init]) ) { symbolArray = [[NSMutableArray alloc] init]; DECLARE_INDEX(loopCounter); int theLimit = [anArray count]; id aCodon; for ( loopCounter = 0 ; loopCounter < theLimit ; loopCounter++ ) { aCodon = (id)ARRAY_GET_VALUE_AT_INDEX(anArray, loopCounter); if ( [aCodon isKindOfClass: [BCCodon class]] ) ARRAY_APPEND_VALUE((NSMutableArray *)symbolArray, aCodon); } int testInt = [theFrame intValue]; if ( testInt == 0 || testInt > 3 || testInt < -3 ) readingFrame = @"+1"; else readingFrame = [theFrame copy]; usedCode = codeType; // fill the NSData buffer with the contents of the array of symbols sequenceData = [[[self sequenceStringFromSymbolArray: symbolArray] dataUsingEncoding: NSUTF8StringEncoding] retain]; } return self; } - (id)initWithString:(NSString *)aString skippingUnknownSymbols:(BOOL)skipFlag; { NSMutableString *converted; BCSequence *aDNASequence; //replace uraciles with thymidines converted = [NSMutableString stringWithString:aString]; [converted replaceOccurrencesOfString:@"u" withString:@"T" options:NSCaseInsensitiveSearch range:NSMakeRange( 0, [converted length])]; //create a new sequence and use for translation aDNASequence=[BCSequence sequenceWithString:aString symbolSet: [BCSymbolSet dnaSymbolSet]]; // defaults on this are fine id theTranslator = [[[BCToolTranslator alloc] initWithSequence:aDNASequence] autorelease]; // fill the NSData buffer with the contents of the NSString sequenceData = [[converted dataUsingEncoding: NSUTF8StringEncoding] retain]; // have the tool create the translation return [theTranslator codonTranslation]; } - (id)initWithSymbolArray:(NSArray *)anArray { BCSequence *aSequence = [BCSequence sequenceWithSymbolArray:anArray]; return [self initWithString: [aSequence sequenceString] skippingUnknownSymbols:YES]; } - (id)initWithCodonArray:(NSArray *)anArray { return [self initWithCodonArray:anArray geneticCode: BCUniversalCode frame:@"+1"]; } + (BCSequenceCodon *)sequenceWithCodonArray:(NSArray *)anArray { return [[[[self class] alloc] initWithCodonArray:anArray] autorelease]; } //needed for initializations //overriding the superclass - (BCSequenceType) sequenceType { return BCSequenceTypeDNA; } // convenience methods for translation - (BCSequence *)translate { return [self translationOfRange: [self longestOpenReadingFrame]]; } //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark ORF/TRANSLATION METHODS #endif // ORF/TRANSLATION METHODS //////////////////////////////////////////////////////////////////////////// - (NSRange) longestOpenReadingFrame { NSArray *theRanges = [self openReadingFramesLongerThanCutoff: 5]; NSRange tempRange; NSRange holdingRange = NSMakeRange (0, 1); int loopCounter; for (loopCounter = 0; loopCounter < [theRanges count]; loopCounter++ ) { tempRange = [[theRanges objectAtIndex: loopCounter] rangeValue]; if ( tempRange.length > holdingRange.length ) holdingRange = tempRange; } return holdingRange; } - (NSRange) longestOpenReadingFrameUsingStartCodon: (id)codon { NSArray *startArray; // we could have been fed a codon or an array of codons - we'll make an array of either if ( ![codon isKindOfClass: [NSArray class]] ) { if ( [codon isKindOfClass: [BCCodon class]] ) startArray = [NSArray arrayWithObject: codon]; else return NSMakeRange( NSNotFound, 0); } else startArray = codon; int maxLength = 0; int startOfMax = 0; int startPos = 0; int theLength = 0; BOOL inORF = NO; DECLARE_INDEX(loopCounter); int theLimit = [symbolArray count]; id aCodon, anAA; BCAminoAcid *noAA = [BCAminoAcid undefined]; for ( loopCounter = 0 ; loopCounter < theLimit ; loopCounter++ ) { aCodon = (id)ARRAY_GET_VALUE_AT_INDEX(symbolArray, loopCounter); anAA = [aCodon codedAminoAcid]; // if we're in an ORF, we can either terminate it or extend it if ( inORF ) { if ( anAA == nil || anAA == noAA ) { // end the ORF inORF = NO; if ( theLength > maxLength ) { startOfMax = startPos; maxLength = theLength; } theLength = 0; } else { theLength++; } } // otherwise, we look to start an ORF else { // see if our codon shows up in the array of start codons if ( ARRAY_RANGE_CONTAINS_VALUE(startArray, MAKE_RANGE(0, ARRAY_GET_COUNT(startArray)), aCodon) ) { startPos = loopCounter; inORF = YES; } } } return NSMakeRange( startOfMax, maxLength); } - (NSArray *) openReadingFramesLongerThanCutoff: (unsigned int)cutoff usingStartCodon: (id)codon { NSArray *startArray; // we could have been fed a codon or an array of codons - we'll make an array of either if ( ![codon isKindOfClass: [NSArray class]] ) { if ( [codon isKindOfClass: [BCCodon class]] ) startArray = [NSArray arrayWithObject: codon]; else return nil; } else startArray = codon; int startPos = 0; int theLength = 0; BOOL inORF = NO; DECLARE_INDEX(loopCounter); int theLimit = [symbolArray count]; id aCodon, anAA; BCAminoAcid *noAA= [BCAminoAcid undefined]; NSMutableArray *theReturn = [NSMutableArray array]; for ( loopCounter = 0 ; loopCounter < theLimit ; loopCounter++ ) { aCodon = (id)ARRAY_GET_VALUE_AT_INDEX(symbolArray, loopCounter); anAA = [aCodon codedAminoAcid]; // if we're in an ORF, we can either terminate it or extend it if ( inORF ) { if ( anAA == nil || anAA == noAA ) { // end the ORF inORF = NO; if ( theLength > cutoff ) [theReturn addObject: [NSValue valueWithRange: NSMakeRange(startPos, theLength)]]; theLength = 0; } else { theLength++; } } // otherwise, we look to start an ORF else { // see if our codon shows up in the array of start codons if ( ARRAY_RANGE_CONTAINS_VALUE(startArray, MAKE_RANGE(0, ARRAY_GET_COUNT(startArray)), aCodon) ) { startPos = loopCounter; inORF = YES; } } } return [[theReturn copy] autorelease]; } - (NSArray *) openReadingFramesLongerThanCutoff: (unsigned int)cutoff { if (cutoff > [self length] ) return nil; int startPos = 0; int theLength = 0; BOOL inORF; DECLARE_INDEX(loopCounter); int theLimit = [symbolArray count]; id aCodon, anAA; BCAminoAcid *noAA= [BCAminoAcid undefined]; NSMutableArray *theReturn = [NSMutableArray array]; for ( loopCounter = 0 ; loopCounter < theLimit ; loopCounter++ ) { aCodon = (id)ARRAY_GET_VALUE_AT_INDEX(symbolArray, loopCounter); anAA = [aCodon codedAminoAcid]; if ( anAA == nil || anAA == noAA ) { // end the ORF inORF = NO; if ( theLength > cutoff ) [theReturn addObject: [NSValue valueWithRange: NSMakeRange(startPos, theLength)]]; theLength = 0; } else { if ( inORF ) theLength++; else { startPos = loopCounter; inORF = YES; } } } return [[theReturn copy] autorelease]; } - (BCSequence *) translationOfRange: (NSRange) theRange { int theLimit = [symbolArray count]; if (theRange.length + theRange.location > theLimit ) return nil; NSArray *subsequence = [symbolArray subarrayWithRange: theRange]; theLimit = [subsequence count]; DECLARE_INDEX(loopCounter); BCAminoAcid *anAA; BCAminoAcid *noAA= [BCAminoAcid undefined]; NSMutableArray *theReturn = [NSMutableArray array]; for ( loopCounter = 0 ; loopCounter < theLimit ; loopCounter++ ) { anAA = [(BCCodon *)ARRAY_GET_VALUE_AT_INDEX(subsequence, loopCounter) codedAminoAcid]; if ( anAA == nil || anAA == noAA ) return [BCSequence sequenceWithSymbolArray: theReturn]; else ARRAY_APPEND_VALUE(theReturn, anAA); } return [BCSequence sequenceWithSymbolArray: theReturn symbolSet: [BCSymbolSet proteinSymbolSet]]; } - (BCSequence *) translationOfRange: (NSRange) theRange usingStartCodon: (id)codon { int theLimit = [symbolArray count]; if (theRange.length + theRange.location > theLimit ) return nil; NSArray *startArray; if ( ![codon isKindOfClass: [NSArray class]] ) { if ( [codon isKindOfClass: [BCCodon class]] ) startArray = [NSArray arrayWithObject: codon]; else return nil; } else startArray = codon; NSArray *subsequence = [symbolArray subarrayWithRange: theRange]; theLimit = [subsequence count]; DECLARE_INDEX(loopCounter); BCCodon *aCodon; BOOL foundStart = NO; for ( loopCounter = 0 ; loopCounter < theLimit ; loopCounter++ ) { aCodon = (BCCodon *)ARRAY_GET_VALUE_AT_INDEX(subsequence, loopCounter); if ( ARRAY_RANGE_CONTAINS_VALUE(startArray, MAKE_RANGE(0, ARRAY_GET_COUNT(startArray)), aCodon) ) { foundStart = YES; break; } } if ( !foundStart ) return nil; return [self translationOfRange: NSMakeRange( theRange.location + loopCounter, theRange.length - loopCounter)]; } - (NSArray *) translationsLongerThanCutoff: (unsigned int)cutoff { NSArray *theRanges = [self openReadingFramesLongerThanCutoff: cutoff]; NSMutableArray *theReturn = [NSMutableArray array]; DECLARE_INDEX(loopCounter); BCSequence *aTranslation; NSRange aRange; int theLimit = [theRanges count]; for ( loopCounter = 0 ; loopCounter < theLimit ; loopCounter++ ) { aRange = [(NSValue *)ARRAY_GET_VALUE_AT_INDEX(theRanges, loopCounter) rangeValue]; aTranslation = [self translationOfRange: aRange]; if ( aTranslation != nil ) ARRAY_APPEND_VALUE(theReturn, aTranslation); } return [[theReturn copy] autorelease]; } - (NSArray *) translationsLongerThanCutoff: (unsigned int)cutoff usingStartCodon: (id)codon { NSArray *theRanges = [self openReadingFramesLongerThanCutoff: cutoff]; NSMutableArray *theReturn = [NSMutableArray array]; DECLARE_INDEX(loopCounter); BCSequence *aTranslation; NSRange aRange; int theLimit = [theRanges count]; for ( loopCounter = 0 ; loopCounter < theLimit ; loopCounter++ ) { aRange = [(NSValue *)ARRAY_GET_VALUE_AT_INDEX(theRanges, loopCounter) rangeValue]; aTranslation = [self translationOfRange: aRange usingStartCodon: codon]; if ( aTranslation != nil ) ARRAY_APPEND_VALUE(theReturn, aTranslation); } return [[theReturn copy] autorelease]; } //////////////////////////////////////////////////////////////////////////// #if 0 #pragma mark #pragma mark BASIC INFO #endif // BASIC INFO //////////////////////////////////////////////////////////////////////////// - (BCGeneticCodeName) usedCode { return usedCode; } - (NSString *)readingFrame { return [[readingFrame copy] autorelease]; } - (NSRange) convertRangeToOriginalSequence: (NSRange)entry { int rfValue = [readingFrame intValue]; if ( rfValue > 0 ) { rfValue = rfValue - 1; return NSMakeRange( (entry.location * 3) + rfValue, (entry.length * 3) ); } rfValue = rfValue + 1; return NSMakeRange( ( ([self length] * 3) - ((entry.length * 3) + entry.location + rfValue) ), entry.length * 3 ); } @end biococoa-2.2.2/BCFoundation/BCSequence/GNUmakefile000644 000765 000024 00000004003 11226023231 022264 0ustar00scottcstaff000000 000000 # # GNUmakefile # # Written by: Scott Christley # Copyright (c) 2003-2009 The BioCocoa Project. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # include $(GNUSTEP_MAKEFILES)/common.make # The library to be compiled SUBPROJECT_NAME = BCSequence # The Objective-C source files to be compiled BCSequence_OBJC_FILES = \ BCAnnotation.m \ BCSequence.m \ BCSequenceArray.m \ BCSequenceCodon.m # The header files BCSequence_HEADER_FILES = \ BCAnnotation.h \ BCSequence.h \ BCSequenceArray.h \ BCSequenceCodon.h BIOCOCOA_BASE_DIR = .. -include $(BIOCOCOA_BASE_DIR)/GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble biococoa-2.2.2/BCFoundation/BCProteinStructure/BCAtom.h000644 000765 000024 00000003317 11223237412 023275 0ustar00scottcstaff000000 000000 // // BCAtom.h // BioCocoa // // Created by Philipp Seibel on 08.05.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import @interface BCAtom : NSObject { NSString *name; float x; float y; float z; } - (NSString *)name; - (float)x; - (float)y; - (float)z; @end biococoa-2.2.2/BCFoundation/BCProteinStructure/BCAtom.m000644 000765 000024 00000003372 11223237412 023303 0ustar00scottcstaff000000 000000 // // BCAtom.m // BioCocoa // // Created by Philipp Seibel on 08.05.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCAtom.h" @implementation BCAtom - (NSString *)name { return name; } - (float)x { return x; } - (float)y { return y; } - (float)z { return z; } - (void)dealloc { [name release]; [super dealloc]; } @end biococoa-2.2.2/BCFoundation/BCProteinStructure/BCChain.h000644 000765 000024 00000003266 11223237412 023422 0ustar00scottcstaff000000 000000 // // BCChain.h // BioCocoa // // Created by Philipp Seibel on 08.05.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import #import "BCSequenceStructure.h" @interface BCChain : BCSequenceStructure { NSString *name; } - (NSString *)name; @end biococoa-2.2.2/BCFoundation/BCProteinStructure/BCChain.m000644 000765 000024 00000003254 11223237412 023424 0ustar00scottcstaff000000 000000 // // BCChain.m // BioCocoa // // Created by Philipp Seibel on 08.05.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCChain.h" @implementation BCChain - (NSString *)name { return name; } - (void)dealloc { [name release]; [super dealloc]; } @end biococoa-2.2.2/BCFoundation/BCProteinStructure/BCProteinStructure.h000644 000765 000024 00000003453 11223237412 025737 0ustar00scottcstaff000000 000000 // // BCProteinStructure.h // BioCocoa // // Created by Philipp Seibel on 08.05.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import @class BCChain; @interface BCProteinStructure : NSObject { NSMutableArray *chains; } - (NSEnumerator *)chainEnumerator; - (NSArray *)chains; - (BCChain *)chainAtIndex:(unsigned int)aIndex; - (unsigned int)chainCount; @end biococoa-2.2.2/BCFoundation/BCProteinStructure/BCProteinStructure.m000644 000765 000024 00000003672 11223237412 025747 0ustar00scottcstaff000000 000000 // // BCProteinStructure.m // BioCocoa // // Created by Philipp Seibel on 08.05.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCProteinStructure.h" @implementation BCProteinStructure - (NSEnumerator *)chainEnumerator { return [chains objectEnumerator]; } - (NSArray *)chains { return chains; } - (BCChain *)chainAtIndex:(unsigned int)aIndex { return (BCChain *)[chains objectAtIndex:aIndex]; } - (unsigned int)chainCount { return [chains count]; } - (void)dealloc { [chains release]; [super dealloc]; } @end biococoa-2.2.2/BCFoundation/BCProteinStructure/BCResidue.h000644 000765 000024 00000003500 11223237412 023767 0ustar00scottcstaff000000 000000 // // BCResidue.h // BioCocoa // // Created by Philipp Seibel on 08.05.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import @class BCAtom, BCAminoAcid; @interface BCResidue : NSObject { NSMutableArray *atoms; BCAminoAcid *aminoAcid; } - (BCAminoAcid *)aminoAcid; - (NSEnumerator *)atomEnumerator; - (BCAtom *)atomAtIndex:(unsigned int)aIndex; - (unsigned int)atomCount; @end biococoa-2.2.2/BCFoundation/BCProteinStructure/BCResidue.m000644 000765 000024 00000003715 11223237412 024004 0ustar00scottcstaff000000 000000 // // BCResidue.m // BioCocoa // // Created by Philipp Seibel on 08.05.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCResidue.h" #import "BCAminoAcid.h" @implementation BCResidue - (BCAminoAcid *)aminoAcid { return aminoAcid; } - (NSEnumerator *)atomEnumerator { return [atoms objectEnumerator]; } - (BCAtom *)atomAtIndex:(unsigned int)aIndex { return (BCAtom *)[atoms objectAtIndex:aIndex]; } - (unsigned int)atomCount { return [atoms count]; } - (void)dealloc { [aminoAcid release]; [atoms release]; [super dealloc]; } @end biococoa-2.2.2/BCFoundation/BCProteinStructure/BCSecondaryStructure.h000644 000765 000024 00000003457 11223237412 026252 0ustar00scottcstaff000000 000000 // // BCSecondaryStructure.h // BioCocoa // // Created by Philipp Seibel on 14.05.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import #import "BCFoundationDefines.h" #import "BCSequenceStructure.h" @interface BCSecondaryStructure : BCSequenceStructure { BCSecondaryStructureType type; NSRange range; } - (BCSecondaryStructureType)type; - (NSRange)range; @end biococoa-2.2.2/BCFoundation/BCProteinStructure/BCSecondaryStructure.m000644 000765 000024 00000003317 11223237412 026252 0ustar00scottcstaff000000 000000 // // BCSecondaryStructure.m // BioCocoa // // Created by Philipp Seibel on 14.05.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCSecondaryStructure.h" @implementation BCSecondaryStructure - (BCSecondaryStructureType)type { return type; } - (NSRange)range { return range; } @end biococoa-2.2.2/BCFoundation/BCProteinStructure/BCSequenceStructure.h000644 000765 000024 00000003435 11223237412 026067 0ustar00scottcstaff000000 000000 // // BCSequenceStructure.h // BioCocoa // // Created by Philipp Seibel on 14.05.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import @class BCResidue, BCSequence; @interface BCSequenceStructure : NSObject { NSMutableArray *residues; BCSequence *sequence; } - (BCSequence *)sequence; - (BCResidue *)residueAtIndex:(unsigned int)aIndex; @end biococoa-2.2.2/BCFoundation/BCProteinStructure/BCSequenceStructure.m000644 000765 000024 00000003567 11223237412 026102 0ustar00scottcstaff000000 000000 // // BCSequenceStructure.m // BioCocoa // // Created by Philipp Seibel on 14.05.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCSequenceStructure.h" #import "BCSequence.h" @implementation BCSequenceStructure - (BCResidue *)residueAtIndex:(unsigned int)aIndex { return (BCResidue *)[residues objectAtIndex:aIndex]; } - (BCSequence *)sequence { return sequence; } - (void)dealloc { [sequence release]; [residues release]; [super dealloc]; } @end biococoa-2.2.2/BCFoundation/BCProteinStructure/GNUmakefile000644 000765 000024 00000004145 11226023231 024064 0ustar00scottcstaff000000 000000 # # GNUmakefile # # Written by: Scott Christley # Copyright (c) 2003-2009 The BioCocoa Project. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # include $(GNUSTEP_MAKEFILES)/common.make # The library to be compiled SUBPROJECT_NAME = BCProteinStructure # The Objective-C source files to be compiled BCProteinStructure_OBJC_FILES = \ BCAtom.m \ BCProteinStructure.m \ BCSecondaryStructure.m \ BCChain.m \ BCResidue.m \ BCSequenceStructure.m # The header files BCProteinStructure_HEADER_FILES = \ BCAtom.h \ BCProteinStructure.h \ BCSecondaryStructure.h \ BCChain.h \ BCResidue.h \ BCSequenceStructure.h BIOCOCOA_BASE_DIR = .. -include $(BIOCOCOA_BASE_DIR)/GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble biococoa-2.2.2/BCFoundation/BCGeneticCode/BCCodon.h000644 000765 000024 00000006176 11223237412 022255 0ustar00scottcstaff000000 000000 // // BCCodon.h // BioCocoa // // Created by John Timmer on 8/31/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Provides codon functionality. */ #import @class BCSymbol, BCAminoAcid; /*! @class BCCodon @abstract Provides codon functionality. @discussion A codon is a composite object, consisting of three bases and a corresponding amino acid. This class * provides the equivalent functionality in code form. You will typically not create these items, but rather access * them via methods in BCGeneticCode. */ @interface BCCodon : NSObject { BCSymbol *firstBase; BCSymbol *secondBase; BCSymbol *wobbleBase; BCAminoAcid *codedAminoAcid; } /*! @method codedAminoAcid @abstract returns the BCAminoAcid encoded by the reciever. Returns nil for stop codons. */ - (BCAminoAcid *) codedAminoAcid; /*! @method aminoAcidSymbolString @abstract returns the symbol string of the amino acid encoded by the receiver. Returns "*" for stop codons. */ - (NSString *) aminoAcidSymbolString; /*! @method tripletString @abstract returns a string representing the three bases of the codon. @discussion calls "symbolString" on each base of the codon, appending the results to generate a single string */ - (NSString *) tripletString; - (NSString *)symbolString; /*! @method description @abstract returns the tripletString */ - (NSString *) description; /*! @method copyWithZone: @abstract returns self to keep the codon a singleton. This may be dangerous, but i don't entirely understand memory zones. */ - (id)copyWithZone:(NSZone *)zone; @end biococoa-2.2.2/BCFoundation/BCGeneticCode/BCCodon.m000644 000765 000024 00000005151 11223237412 022252 0ustar00scottcstaff000000 000000 // // BCCodon.m // BioCocoa // // Created by John Timmer on 8/31/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCCodon.h" #import "BCSequence.h" #import "BCAminoAcid.h" #import "BCSymbol.h" @implementation BCCodon - (BCAminoAcid *) codedAminoAcid { return codedAminoAcid; } - (BCSequence *) triplet { NSArray *tempArray = [NSArray arrayWithObjects: firstBase, secondBase, wobbleBase, nil]; return [BCSequence sequenceWithSymbolArray: tempArray]; } - (NSString *) aminoAcidSymbolString { if ( codedAminoAcid == nil ) return @"*"; else return [codedAminoAcid symbolString]; } - (NSString *) tripletString { NSMutableString *returnString = [NSMutableString stringWithString: [firstBase symbolString]]; [returnString appendString: [secondBase symbolString]]; [returnString appendString: [wobbleBase symbolString]]; return [[returnString copy] autorelease]; } - (NSString *)symbolString { return [[self aminoAcidSymbolString] stringByAppendingString: [NSString stringWithFormat: @"(%@)", [self tripletString]]]; } - (NSString *) description { return [self tripletString]; } - (id)copyWithZone:(NSZone *)zone { return self; } @end biococoa-2.2.2/BCFoundation/BCGeneticCode/BCCodonDNA.h000644 000765 000024 00000006545 11223237412 022600 0ustar00scottcstaff000000 000000 // // BCCodonDNA.h // BioCocoa // // Created by John Timmer on 8/31/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Provides codon functionality for translation of DNA sequences. */ #import #import "BCCodon.h" @class BCSequence; /*! @class BCCodonDNA @abstract Provides codon functionality for translation of DNA sequences @discussion A codon is a composite object, consisting of three bases and a corresponding amino acid. This class * provides the equivalent functionality in code form. The common (amino acid) portion of the class is implemented * by the superclass, BCCodon. The DNA specific form provides a designated initilization * routine and methods for querying its base component. You will typically not create these items, but rather access * them via methods in BCGeneticCode. */ @interface BCCodonDNA : BCCodon { } /*! @method unmatched @abstract provides access to a singleton codon that represents a generic non-coding triplet */ + (BCCodonDNA *)unmatched; /*! @method initWithDNASequenceString:andAminoAcidString: @abstract designated class initilizer @discussion takes the supplied strings and uses them to get references to the corresponding BCSymbol objects. Will return * nil if any of these objects cannot be created with the given strings, or the strings are malformed. */ - (BCCodonDNA *)initWithDNASequenceString: (NSString *)sequenceString andAminoAcidString: (NSString *)aaString; /*! @method triplet @abstract returns a BCSequence comprised of the appropriate bases */ - (BCSequence *) triplet; /*! @method matchesTriplet: @abstract returns yes only if every base of the entry is represented by the bases of the codon in the appropriate order. @discussion implementation of this method accounts for ambiguous bases. */ - (BOOL) matchesTriplet: (NSArray *)entry; @end biococoa-2.2.2/BCFoundation/BCGeneticCode/BCCodonDNA.m000644 000765 000024 00000007220 11223237412 022574 0ustar00scottcstaff000000 000000 // // BCCodon.m // BioCocoa // // Created by John Timmer on 8/31/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCCodonDNA.h" #import "BCSequence.h" #import "BCAminoAcid.h" #import "BCSymbol.h" #import "BCNucleotideDNA.h" static BCCodonDNA *unmatchedCodon = nil; @implementation BCCodonDNA - (BCCodonDNA *)initWithDNASequenceString: (NSString *)sequenceString andAminoAcidString: (NSString *)aaString { self = [super init]; if ( self == nil ) return self; if ( ![aaString isEqualToString: @"stop"] ) codedAminoAcid = [BCAminoAcid performSelector: NSSelectorFromString( aaString )]; else codedAminoAcid = nil; if ( [sequenceString length] != 3) return nil; firstBase = [BCNucleotideDNA symbolForChar: [sequenceString characterAtIndex: 0]]; if ( firstBase == nil || firstBase == [BCNucleotideDNA undefined] ) return nil; secondBase = [BCNucleotideDNA symbolForChar: [sequenceString characterAtIndex: 1]]; if ( secondBase == nil || secondBase == [BCNucleotideDNA undefined] ) return nil; wobbleBase = [BCNucleotideDNA symbolForChar: [sequenceString characterAtIndex: 2]]; if ( wobbleBase == nil || wobbleBase == [BCNucleotideDNA undefined] ) return nil; return self; } - (BCCodon *) init { return nil; } //- (void) dealloc { // // [super release]; //} + (BCCodonDNA *)unmatched { if ( unmatchedCodon == nil) unmatchedCodon = [[BCCodonDNA alloc] initWithDNASequenceString: @"---" andAminoAcidString: @"undefined"]; return unmatchedCodon; } - (BOOL) matchesTriplet: (NSArray *)entry { if ( ![(BCNucleotideDNA *)[entry objectAtIndex: 0] isRepresentedBySymbol: (BCNucleotideDNA *)firstBase] ) return NO; if ( ![(BCNucleotideDNA *)[entry objectAtIndex: 1] isRepresentedBySymbol: (BCNucleotideDNA *)secondBase] ) return NO; if ( ![(BCNucleotideDNA *)[entry objectAtIndex: 2] isRepresentedBySymbol: (BCNucleotideDNA *)wobbleBase] ) return NO; return YES; } - (BCSequence *) triplet { NSArray *tempArray = [NSArray arrayWithObjects: firstBase, secondBase, wobbleBase, nil]; return [BCSequence sequenceWithSymbolArray: tempArray]; } @end biococoa-2.2.2/BCFoundation/BCGeneticCode/BCCodonRNA.h000644 000765 000024 00000006527 11223237412 022616 0ustar00scottcstaff000000 000000 // // BCCodon.h // BioCocoa // // Created by John Timmer on 8/31/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Provides codon functionality for translation of RNA sequences. */ #import #import "BCCodon.h" @class BCSequence; /*! @class BCCodonRNA @abstract Provides codon functionality for translation of RNA sequences @discussion A codon is a composite object, consisting of three bases and a corresponding amino acid. This class * provides the equivalent functionality in code form. The common (amino acid) portion of the class is implemented * by the superclass, BCCodon. The RNA specific form provides a designated initilization * routine and methods for querying its base component. You will typically not create these items, but rather access * them via methods in BCGeneticCode. */ @interface BCCodonRNA : BCCodon { } /*! @method unmatched @abstract provides access to a singleton codon that represents a generic non-coding triplet */ + (BCCodonRNA *)unmatched; /*! @method initWithRNASequenceString:andAminoAcidString: @abstract designated class initilizer @discussion takes the supplied strings and uses them to get references to the corresponding BCSymbol objects. Will return * nil if any of these objects cannot be created with the given strings, or the strings are malformed. */ - (BCCodonRNA *)initWithRNASequenceString: (NSString *)sequenceString andAminoAcidString: (NSString *)aaString; /*! @method triplet @abstract returns a BCSequence comprised of the appropriate bases */ - (BCSequence *) triplet; /*! @method matchesTriplet: @abstract returns yes only if every base of the entry is represented by the bases of the codon in the appropriate order. @discussion implementation of this method accounts for ambiguous bases. */ - (BOOL) matchesTriplet: (NSArray *)entry; @end biococoa-2.2.2/BCFoundation/BCGeneticCode/BCCodonRNA.m000644 000765 000024 00000007225 11223237412 022617 0ustar00scottcstaff000000 000000 // // BCCodon.m // BioCocoa // // Created by John Timmer on 8/31/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCCodonRNA.h" //#import "BCSequenceRNA.h" #import "BCSequence.h" #import "BCAminoAcid.h" #import "BCNucleotideRNA.h" static BCCodonRNA *unmatchedCodon = nil; @implementation BCCodonRNA - (BCCodonRNA *)initWithRNASequenceString: (NSString *)sequenceString andAminoAcidString: (NSString *)aaString { self = [super init]; if ( self == nil ) return self; if ( ![aaString isEqualToString: @"stop"] ) codedAminoAcid = [BCAminoAcid performSelector: NSSelectorFromString( aaString )]; else codedAminoAcid = nil; if ( [sequenceString length] != 3) return nil; firstBase = [BCNucleotideRNA symbolForChar: [sequenceString characterAtIndex: 0]]; if ( firstBase == nil || firstBase == [BCNucleotideRNA undefined] ) return nil; secondBase = [BCNucleotideRNA symbolForChar: [sequenceString characterAtIndex: 1]]; if ( secondBase == nil || secondBase == [BCNucleotideRNA undefined] ) return nil; wobbleBase = [BCNucleotideRNA symbolForChar: [sequenceString characterAtIndex: 2]]; if ( wobbleBase == nil || wobbleBase == [BCNucleotideRNA undefined] ) return nil; return self; } - (BCCodon *) init { return nil; } //- (void) dealloc { // // [super release]; //} - (BOOL) matchesTriplet: (NSArray *)entry { if ( ![(BCNucleotideRNA *)[entry objectAtIndex: 0] isRepresentedBySymbol: (BCNucleotideRNA *)firstBase] ) return NO; if ( ![(BCNucleotideRNA *)[entry objectAtIndex: 1] isRepresentedBySymbol: (BCNucleotideRNA *)secondBase] ) return NO; if ( ![(BCNucleotideRNA *)[entry objectAtIndex: 2] isRepresentedBySymbol: (BCNucleotideRNA *)wobbleBase] ) return NO; return YES; } + (BCCodonRNA *)unmatched { if ( unmatchedCodon == nil) unmatchedCodon = [[BCCodonRNA alloc] initWithRNASequenceString: @"---" andAminoAcidString: @"undefined"]; return unmatchedCodon; } - (BCSequence *) triplet { NSArray *tempArray = [NSArray arrayWithObjects: firstBase, secondBase, wobbleBase, nil]; return [BCSequence sequenceWithSymbolArray: tempArray]; } @end biococoa-2.2.2/BCFoundation/BCGeneticCode/BCGeneticCode.h000644 000765 000024 00000005501 11223237412 023353 0ustar00scottcstaff000000 000000 // // BCGeneticCode.h // BioCocoa // // Created by John Timmer on 8/31/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Provides an interface for obtaining the codons of different genetic codes. */ #import #import "BCFoundationDefines.h" @class BCSequence, BCCodonRNA, BCCodonDNA, BCCodon, BCNucleotideDNA, BCNucleotideRNA, BCAminoAcid; // @class BCSequence, BCSequenceRNA /*! @class BCGeneticCode @abstract Provides an interface for obtaining the codons of different genetic codes. @discussion Genetic codes are essentially a translation dictionary implemented in BCCodons. * This class does not get implemented, but rather creates and allows access to NSArrays that * contain the appropriate set of codons for a given genetic code. Individual codes can be * accessed either by their BCGeneticCodeName, or via appropriately named class methods. */ @interface BCGeneticCode : NSObject { } + (NSArray *) geneticCode: (BCGeneticCodeName)codeType forSequenceType: (BCSequenceType)seqType; + (BCCodon *) codon: (BCSequence*)aCodon inGeneticCode: (BCGeneticCodeName)codeType; + (NSArray *) universalGeneticCodeDNA; + (NSArray *) universalGeneticCodeRNA; + (void) initUniversalGeneticCode; + (NSArray *) vertebrateMitochondrialGeneticCodeDNA; + (NSArray *) vertebrateMitochondrialGeneticCodeRNA; + (void) initVertebrateMitochondrialGeneticCode; @end biococoa-2.2.2/BCFoundation/BCGeneticCode/BCGeneticCode.m000644 000765 000024 00000022226 11223237412 023363 0ustar00scottcstaff000000 000000 // // BCGeneticCode.m // BioCocoa // // Created by John Timmer on 8/31/04. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCFoundationDefines.h" #import "BCSequence.h" //#import "BCSequenceRNA.h" #import "BCAminoAcid.h" #import "BCNucleotideDNA.h" #import "BCNucleotideRNA.h" #import "BCCodon.h" #import "BCCodonDNA.h" #import "BCCodonRNA.h" #import "BCGeneticCode.h" #import "BCInternal.h" static NSArray *universalGeneticCodeDNA = nil; static NSArray *universalGeneticCodeRNA = nil; static NSArray *vertebrateMitochondrialGeneticCodeDNA = nil; static NSArray *vertebrateMitochondrialGeneticCodeRNA = nil; @interface BCGeneticCode (private) /////////////////////////////////////////////////////////////////////// // private methods below /////////////////////////////////////////////////////////////////////// + (NSMutableDictionary *) priv_createCodonArraysFromDictionary: (NSDictionary *)entry; + (NSMutableDictionary *) priv_modifyTemplateInfo: (NSDictionary *)template usingInfo: (NSDictionary *)revisions; @end @implementation BCGeneticCode + (NSArray *) geneticCode: (BCGeneticCodeName)codeType forSequenceType: (BCSequenceType)seqType { switch ( codeType ) { case BCUniversalCode : { if ( seqType == BCSequenceTypeDNA ) return [BCGeneticCode universalGeneticCodeDNA]; else if ( seqType == BCSequenceTypeRNA ) return [BCGeneticCode universalGeneticCodeRNA]; else return nil; break; } case BCVertebrateMitochondrial : { if ( seqType == BCSequenceTypeDNA ) return [BCGeneticCode vertebrateMitochondrialGeneticCodeDNA]; else if ( seqType == BCSequenceTypeRNA ) return [BCGeneticCode vertebrateMitochondrialGeneticCodeRNA]; else return nil; break; } } return nil; } + (BCCodon *) codon: (BCSequence*)aCodon inGeneticCode: (BCGeneticCodeName)codeType { if ( [aCodon length] != 3 ) return nil; NSArray *theCode; if ( [aCodon isKindOfClass: [BCSequence class]] ) { theCode = [BCGeneticCode geneticCode: codeType forSequenceType: BCSequenceTypeDNA]; DECLARE_INDEX(loopCounter); int aLimit = [theCode count]; BCCodonDNA *aKey; for ( loopCounter = 0; loopCounter < aLimit ; loopCounter++ ) { aKey = (BCCodonDNA *)ARRAY_GET_VALUE_AT_INDEX(theCode, loopCounter); if ( [aKey matchesTriplet: [aCodon symbolArray]] ) return aKey; } } // else if ( [aCodon isKindOfClass: [BCSequenceRNA class]] ) { // theCode = [BCGeneticCode geneticCode: codeType forSequenceType: BCSequenceTypeRNA]; // CFIndex loopCounter; // int aLimit = [theCode count]; // BCCodonRNA *aKey; // for ( loopCounter = 0; loopCounter < aLimit ; loopCounter++ ) { // aKey = (BCCodonRNA *)CFArrayGetValueAtIndex( (CFArrayRef) theCode, loopCounter) ; // if ( [aKey matchesTriplet: [aCodon symbolArray]] ) // return aKey; // } // } return nil; } + (NSArray *) universalGeneticCodeDNA { if ( universalGeneticCodeDNA == nil ) [BCGeneticCode initUniversalGeneticCode]; return universalGeneticCodeDNA; } + (NSArray *) universalGeneticCodeRNA { if ( universalGeneticCodeRNA == nil ) [BCGeneticCode initUniversalGeneticCode]; return universalGeneticCodeRNA; } + (void) initUniversalGeneticCode { // initialize the genetic code from a dictionary stored as a file NSBundle *biococoaBundle = [NSBundle bundleForClass: [BCGeneticCode class]]; NSString *filePath = [biococoaBundle pathForResource: @"universal genetic code" ofType: @"plist"]; if ( filePath == nil ) return; NSMutableDictionary *transDict = [NSMutableDictionary dictionaryWithContentsOfFile: filePath]; if ( transDict == nil ) return; transDict = [BCGeneticCode priv_createCodonArraysFromDictionary: transDict]; if ( transDict == nil ) return; universalGeneticCodeDNA = [[transDict objectForKey: @"DNA"] copy]; universalGeneticCodeRNA = [[transDict objectForKey: @"RNA"] copy]; } + (NSArray *) vertebrateMitochondrialGeneticCodeDNA { if ( vertebrateMitochondrialGeneticCodeDNA == nil ) [BCGeneticCode initVertebrateMitochondrialGeneticCode]; return vertebrateMitochondrialGeneticCodeDNA; } + (NSArray *) vertebrateMitochondrialGeneticCodeRNA { if ( vertebrateMitochondrialGeneticCodeRNA == nil ) [BCGeneticCode initVertebrateMitochondrialGeneticCode]; return vertebrateMitochondrialGeneticCodeRNA; } + (void) initVertebrateMitochondrialGeneticCode { // initialize the genetic code from a dictionary stored as a file NSBundle *biococoaBundle = [NSBundle bundleForClass: [BCGeneticCode class]]; NSString *filePath = [biococoaBundle pathForResource: @"universal genetic code" ofType: @"plist"]; if ( filePath == nil ) return; NSDictionary *transDict = [NSMutableDictionary dictionaryWithContentsOfFile: filePath]; if ( transDict == nil ) return; filePath = [biococoaBundle pathForResource: @"vertebrate mitochondrial genetic code" ofType: @"plist"]; NSDictionary *revisions = [NSMutableDictionary dictionaryWithContentsOfFile: filePath]; transDict = [BCGeneticCode priv_modifyTemplateInfo: transDict usingInfo: revisions]; transDict = [BCGeneticCode priv_createCodonArraysFromDictionary: transDict]; if ( transDict == nil ) return; vertebrateMitochondrialGeneticCodeDNA = [[transDict objectForKey: @"DNA"] copy]; vertebrateMitochondrialGeneticCodeRNA = [[transDict objectForKey: @"RNA"] copy]; } /////////////////////////////////////////////////////////////////////// // private methods below /////////////////////////////////////////////////////////////////////// + (NSMutableDictionary *) priv_createCodonArraysFromDictionary: (NSDictionary *)entry { NSMutableArray *DNAArray = [NSMutableArray array]; NSMutableArray *RNAArray = [NSMutableArray array]; NSEnumerator *keyEnumerator = [entry keyEnumerator]; NSString *aKey; NSMutableString *anotherString; BCCodon *aCodon, *RNACodon; while ( (aKey = [keyEnumerator nextObject]) ) { aCodon = [[[BCCodonDNA alloc] initWithDNASequenceString: aKey andAminoAcidString: [entry objectForKey: aKey]] autorelease]; if ( aCodon != nil ) [DNAArray addObject: aCodon]; anotherString = [[aKey mutableCopy] autorelease]; [anotherString replaceOccurrencesOfString: @"T" withString: @"U" options: NSCaseInsensitiveSearch range: NSMakeRange(0, 3)]; RNACodon = [[[BCCodonRNA alloc] initWithRNASequenceString: anotherString andAminoAcidString: [entry objectForKey: aKey]] autorelease]; if ( aCodon != nil ) [RNAArray addObject: aCodon]; } if ( [DNAArray count] < 21 ) return nil; NSMutableDictionary *theReturn = [NSMutableDictionary dictionaryWithObject: DNAArray forKey: @"DNA"]; [theReturn setObject: RNAArray forKey: @"RNA"]; return theReturn; } + (NSMutableDictionary *) priv_modifyTemplateInfo: (NSDictionary *)template usingInfo: (NSDictionary *)revisions { NSMutableDictionary *theReturn = [template mutableCopy]; NSArray *deletions = [revisions objectForKey: @"keys to delete"]; if ( deletions == nil ) return nil; DECLARE_INDEX(loopCounter); int aLimit = [deletions count]; NSString *aKey; for ( loopCounter = 0; loopCounter < aLimit ; loopCounter++ ) { aKey = (NSString *)ARRAY_GET_VALUE_AT_INDEX(deletions, loopCounter); [theReturn removeObjectForKey: aKey]; } [theReturn addEntriesFromDictionary: [revisions objectForKey: @"keys to add"]]; return [theReturn autorelease]; } @end biococoa-2.2.2/BCFoundation/BCGeneticCode/Genetic Codes/000755 000765 000024 00000000000 11455661314 023230 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCFoundation/BCGeneticCode/GNUmakefile000644 000765 000024 00000003764 11226023231 022702 0ustar00scottcstaff000000 000000 # # GNUmakefile # # Written by: Scott Christley # Copyright (c) 2003-2009 The BioCocoa Project. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # include $(GNUSTEP_MAKEFILES)/common.make # The library to be compiled SUBPROJECT_NAME = BCGeneticCode # The Objective-C source files to be compiled BCGeneticCode_OBJC_FILES = \ BCCodonDNA.m \ BCCodon.m \ BCCodonRNA.m \ BCGeneticCode.m # The header files BCGeneticCode_HEADER_FILES = \ BCCodonDNA.h \ BCCodon.h \ BCCodonRNA.h \ BCGeneticCode.h BIOCOCOA_BASE_DIR = .. -include $(BIOCOCOA_BASE_DIR)/GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble biococoa-2.2.2/BCFoundation/BCGeneticCode/Genetic Codes/universal genetic code.plist000644 000765 000024 00000002520 10404057133 030575 0ustar00scottcstaff000000 000000 AAR lysine AAY asparagine ACN threonine AGR arginine AGY serine ATG methionine ATH isoleucine CAR glutamine CAY histidine CCN proline CGN arginine CTN leucine GAR glutamicacid GAY asparticacid GCN alanine GGN glycine GTN valine MGR arginine TAR stop TAY tyrosine TCN serine TGA stop TGG tryptophan TGY cysteine TTR leucine TTY phenylalanine YTR leucine biococoa-2.2.2/BCFoundation/BCGeneticCode/Genetic Codes/vertebrate mitochondrial genetic code.plist000644 000765 000024 00000001106 10404057133 033544 0ustar00scottcstaff000000 000000 keys to add AGR stop ATR methionine ATY isoleucine TGR tryptophane keys to delete TGA TGG ATH ATG AGR biococoa-2.2.2/BCFoundation/BCGeneExpression/BCParseSOFT.h000644 000765 000024 00000004004 11223237412 023532 0ustar00scottcstaff000000 000000 // // BCParseSOFT.h // BioCocoa // // Created by Scott Christley on 10/07/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Parse gene expression data in SOFT format. */ #import @interface BCParseSOFT : NSObject { NSMutableArray *series; NSMutableArray *platforms; NSMutableArray *samples; } // Parse gene expression data in SOFT format - (BOOL)parseFile: (NSString *)fileName; - (BOOL)parseFile: (NSString *)fileName headersOnly: (BOOL)flag; // Retrieve parsed data - (NSArray *)getSeries; - (NSArray *)getPlatforms; - (NSArray *)getSamples; @end biococoa-2.2.2/BCFoundation/BCGeneExpression/BCParseSOFT.m000644 000765 000024 00000026355 11226023231 023547 0ustar00scottcstaff000000 000000 // // BCParseSOFT.m // BioCocoa // // Created by Scott Christley on 10/07/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCParseSOFT.h" #import "BCSeries.h" #import "BCPlatform.h" #import "BCSample.h" @implementation BCParseSOFT - init { self = [super init]; if (self) { series = [NSMutableArray new]; platforms = [NSMutableArray new]; samples = [NSMutableArray new]; } return self; } - (void)dealloc { if (series) [series release]; if (platforms) [platforms release]; if (samples) [samples release]; [super dealloc]; } // // Parse gene expression data in SOFT format // - (BOOL)parseFile: (NSString *)fileName { return [self parseFile: fileName headersOnly: NO]; } - (BOOL)parseFile: (NSString *)fileName headersOnly: (BOOL)flag { NSError *e; NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSString *s = [NSString stringWithContentsOfFile: fileName encoding: NSUTF8StringEncoding error: &e]; if (!s) { printf("Could not open file: %s\n", [fileName UTF8String]); printf("%s\n", [[e localizedDescription] UTF8String]); //NSRunAlertPanel(@"File Open Error", [e localizedDescription], nil, nil, nil); goto failure; } NSArray *a = [s componentsSeparatedByString: @"\n"]; //printf("%d\n", [a count]); int i; int parseState = 0; NSString *seriesName, *platformName, *sampleName; BCSeries *aSeries = nil; BCPlatform *aPlatform = nil; BCSample *aSample = nil; NSMutableArray *probeSet = nil, *sampleSet = nil; NSArray *probeSetColumns = nil, *sampleSetColumns = nil; NSCharacterSet *trimSet = [NSCharacterSet whitespaceAndNewlineCharacterSet]; for (i = 0; i < [a count]; ++i) { // for (i = 0; i < 10000; ++i) { NSString *s = [a objectAtIndex: i]; if (!s) continue; if ([s length] == 0) continue; //printf("Starting parse of line (state %d):\n", parseState); //printf("%s\n", [s UTF8String]); if ([s characterAtIndex: 0] == '^') { // Series data NSRange r = [s rangeOfString: @"^SERIES"]; if (r.location != NSNotFound) { r = [s rangeOfString: @"="]; if (r.location == NSNotFound) { printf("ERROR"); goto failure; } else { ++r.location; r.length = [s length] - r.location; seriesName = [[s substringWithRange: r] stringByTrimmingCharactersInSet: trimSet]; //printf("series: %s\n", [seriesName UTF8String]); // check if we already have this series data loaded aSeries = [BCSeries seriesWithId: seriesName]; if (!aSeries) { aSeries = [[BCSeries alloc] initWithId: seriesName]; [BCSeries addSeries: aSeries]; parseState = 1; } else parseState = 0; } continue; } // Platform data r = [s rangeOfString: @"^PLATFORM"]; if (r.location != NSNotFound) { r = [s rangeOfString: @"="]; if (r.location == NSNotFound) { printf("ERROR"); goto failure; } else { ++r.location; r.length = [s length] - r.location; platformName = [[s substringWithRange: r] stringByTrimmingCharactersInSet: trimSet]; //printf("platform: %s\n", [platformName UTF8String]); // check if we already have this platform loaded aPlatform = [BCPlatform platformWithId: platformName]; if (!aPlatform) { aPlatform = [[BCPlatform alloc] initWithId: platformName]; [BCPlatform addPlatform: aPlatform]; parseState = 2; } else parseState = 0; } continue; } // Sample data r = [s rangeOfString: @"^SAMPLE"]; if (r.location != NSNotFound) { r = [s rangeOfString: @"="]; if (r.location == NSNotFound) { printf("ERROR"); goto failure; } else { ++r.location; r.length = [s length] - r.location; sampleName = [[s substringWithRange: r] stringByTrimmingCharactersInSet: trimSet]; //printf("sample: %s\n", [sampleName UTF8String]); // check if we already have this platform loaded aSample = [BCSample sampleWithId: sampleName]; if (!aSample) { aSample = [[BCSample alloc] initWithId: sampleName]; [BCSample addSample: aSample]; parseState = 4; } else parseState = 0; } continue; } } switch (parseState) { // looking for next section case 0: break; // parsing series data case 1: { NSRange r1 = [s rangeOfString: @"="]; NSRange r2; r2.length = r1.location - 1; r2.location = 1; NSString *key = [[s substringWithRange: r2] stringByTrimmingCharactersInSet: trimSet]; r2.location = r1.location + 1; r2.length = [s length] - r2.location; NSString *value = [[s substringWithRange: r2] stringByTrimmingCharactersInSet: trimSet]; //printf("key: %s\n", [key UTF8String]); //printf("value: %s\n", [value UTF8String]); [aSeries setValue: value forKey: key]; break; } // parsing platform data case 2: { // beginning of platform probe set entries NSRange r = [s rangeOfString: @"!platform_table_begin"]; if (r.location != NSNotFound) { ++i; // skip the first entry of headers if (!flag) { probeSet = [NSMutableArray array]; [aPlatform setValue: probeSet forKey: @"Probe Set"]; probeSetColumns = [aPlatform valuesForKey: @"Probe Set Columns"]; } parseState = 3; continue; } // platform header entries if ([s characterAtIndex: 0] == '!') { NSRange r1 = [s rangeOfString: @"="]; NSRange r2; r2.length = r1.location - 1; r2.location = 1; NSString *key = [[s substringWithRange: r2] stringByTrimmingCharactersInSet: trimSet]; r2.location = r1.location + 1; r2.length = [s length] - r2.location; NSString *value = [[s substringWithRange: r2] stringByTrimmingCharactersInSet: trimSet]; //printf("key: %s\n", [key UTF8String]); //printf("value: %s\n", [value UTF8String]); [aPlatform setValue: value forKey: key]; continue; } // platform probe set headers if ([s characterAtIndex: 0] == '#') { NSRange r1 = [s rangeOfString: @"="]; NSRange r2; r2.length = r1.location - 1; r2.location = 1; NSString *key = [[s substringWithRange: r2] stringByTrimmingCharactersInSet: trimSet]; r2.location = r1.location + 1; r2.length = [s length] - r2.location; NSString *value = [[s substringWithRange: r2] stringByTrimmingCharactersInSet: trimSet]; //printf("key: %s\n", [key UTF8String]); //printf("value: %s\n", [value UTF8String]); [aPlatform setValue: key forKey: @"Probe Set Columns"]; [aPlatform setValue: value forKey: @"Probe Set Column Descriptions"]; continue; } break; } // parsing platform probe set entries case 3: { // end of platform probe set entries NSRange r = [s rangeOfString: @"!platform_table_end"]; if (r.location != NSNotFound) { probeSet = nil; probeSetColumns = nil; parseState = 0; continue; } if (!flag) { NSArray *f = [s componentsSeparatedByString: @"\t"]; if ([f count] != [probeSetColumns count]) NSLog(@"ERROR: probe set columns %d != %d entries\n", [probeSetColumns count], [f count]); [probeSet addObject: f]; //[probeSet setObject: f forKey: [f objectAtIndex: 0]]; } break; } // parsing sample data case 4: { // beginning of sample data entries NSRange r = [s rangeOfString: @"!sample_table_begin"]; if (r.location != NSNotFound) { ++i; // skip the first entry of headers if (!flag) { sampleSet = [NSMutableArray array]; [aSample setValue: sampleSet forKey: @"Sample Data"]; sampleSetColumns = [aSample valuesForKey: @"Sample Data Columns"]; } parseState = 5; continue; } // sample header entries if ([s characterAtIndex: 0] == '!') { NSRange r1 = [s rangeOfString: @"="]; NSRange r2; r2.length = r1.location - 1; r2.location = 1; NSString *key = [[s substringWithRange: r2] stringByTrimmingCharactersInSet: trimSet]; r2.location = r1.location + 1; r2.length = [s length] - r2.location; NSString *value = [[s substringWithRange: r2] stringByTrimmingCharactersInSet: trimSet]; //printf("key: %s\n", [key UTF8String]); //printf("value: %s\n", [value UTF8String]); [aSample setValue: value forKey: key]; continue; } // sample data headers if ([s characterAtIndex: 0] == '#') { NSRange r1 = [s rangeOfString: @"="]; NSRange r2; r2.length = r1.location - 1; r2.location = 1; NSString *key = [[s substringWithRange: r2] stringByTrimmingCharactersInSet: trimSet]; r2.location = r1.location + 1; r2.length = [s length] - r2.location; NSString *value = [[s substringWithRange: r2] stringByTrimmingCharactersInSet: trimSet]; //printf("key: %s\n", [key UTF8String]); //printf("value: %s\n", [value UTF8String]); [aSample setValue: key forKey: @"Sample Data Columns"]; [aSample setValue: value forKey: @"Sample Data Column Descriptions"]; continue; } break; } // parsing sample data entries case 5: { // end of sample data entries NSRange r = [s rangeOfString: @"!sample_table_end"]; if (r.location != NSNotFound) { sampleSet = nil; sampleSetColumns = nil; parseState = 0; continue; } if (!flag) { NSArray *f = [s componentsSeparatedByString: @"\t"]; if ([f count] != [sampleSetColumns count]) NSLog(@"ERROR: sample data columns %d != %d entries\n", [sampleSetColumns count], [f count]); [sampleSet addObject: f]; //NSLog(@"%d\n", [sampleSet count]); //[sampleSet setObject: f forKey: [f objectAtIndex: 0]]; } break; } } } [pool release]; return YES; failure: [pool release]; return NO; } // // Retrieve parsed data // - (NSArray *)getSeries { return [NSArray arrayWithArray: series]; } - (NSArray *)getPlatforms { return [NSArray arrayWithArray: platforms]; } - (NSArray *)getSamples { return [NSArray arrayWithArray: samples]; } @end biococoa-2.2.2/BCFoundation/BCGeneExpression/BCPlatform.h000644 000765 000024 00000004122 11223237412 023551 0ustar00scottcstaff000000 000000 // // BCPlatform.h // BioCocoa // // Created by Scott Christley on 10/07/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import /*! @header @abstract Gene expression platforms. */ @interface BCPlatform : NSObject { NSMutableDictionary *attributes; } // Access global list of platforms + (NSDictionary *)getAllPlatforms; + (BCPlatform *)platformWithId: (NSString *)anId; + (void)addPlatform: (BCPlatform *)aPlatform; // Default constructor - initWithId: (NSString *)anId; // Accessor methods - (NSString *)getId; - (id)valueForKey: (NSString *)aKey; - (NSArray *)valuesForKey: (NSString *)aKey; - (void)setValue:(id)value forKey:(NSString *)key; @end biococoa-2.2.2/BCFoundation/BCGeneExpression/BCPlatform.m000644 000765 000024 00000006710 11223237412 023563 0ustar00scottcstaff000000 000000 // // BCPlatform.m // BioCocoa // // Created by Scott Christley on 10/07/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCPlatform.h" // Global list of all platforms static NSMutableDictionary *platforms = nil; static NSMutableDictionary *get_all_platforms() { if (!platforms) { platforms = [NSMutableDictionary new]; } return platforms; } @implementation BCPlatform // Access global list of platforms + (NSDictionary *)getAllPlatforms { return [NSDictionary dictionaryWithDictionary: get_all_platforms()]; } + (BCPlatform *)platformWithId: (NSString *)anId { NSDictionary *d = get_all_platforms(); return [d objectForKey: anId]; } + (void)addPlatform: (BCPlatform *)aPlatform { NSString *id = [aPlatform getId]; NSMutableDictionary *d = get_all_platforms(); [d setObject: aPlatform forKey: id]; } // Default constructor - initWithId: (NSString *)anId { self = [super init]; if (self) { attributes = [NSMutableDictionary new]; [attributes setObject: anId forKey: @"id"]; } return self; } // Accessor methods - (NSString *)getId { return [attributes objectForKey: @"id"]; } - (id)valueForKey: (NSString *)aKey { id aValue = [attributes objectForKey: aKey]; if ((aValue) && ([aValue isKindOfClass: [NSArray class]])) { if ([aValue count] == 0) return nil; else return [aValue objectAtIndex: 0]; } return aValue; } - (NSArray *)valuesForKey: (NSString *)aKey { id aValue = [attributes objectForKey: aKey]; if (!aValue) return [NSArray array]; if ([aValue isKindOfClass: [NSArray class]]) { return aValue; } else return [NSArray arrayWithObject: aValue]; } - (void)setValue:(id)aValue forKey:(NSString *)aKey { id anEntry = [attributes objectForKey: aKey]; if (!anEntry) [attributes setObject: aValue forKey: aKey]; else { if ([anEntry isKindOfClass: [NSArray class]]) { [anEntry addObject: aValue]; } else { NSMutableArray *a = [NSMutableArray arrayWithObject: anEntry]; [a addObject: aValue]; [attributes setObject: a forKey: aKey]; } } } @end biococoa-2.2.2/BCFoundation/BCGeneExpression/BCSample.h000644 000765 000024 00000004075 11223237412 023215 0ustar00scottcstaff000000 000000 // // BCSample.h // BioCocoa // // Created by Scott Christley on 10/07/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Gene expression sample. */ #import @interface BCSample : NSObject { NSMutableDictionary *attributes; } // Access global list of samples + (NSDictionary *)getAllSamples; + (BCSample *)sampleWithId: (NSString *)anId; + (void)addSample: (BCSample *)aSample; // Default constructor - initWithId: (NSString *)anId; // Accessor methods - (NSString *)getId; - (id)valueForKey: (NSString *)aKey; - (NSArray *)valuesForKey: (NSString *)aKey; - (void)setValue:(id)value forKey:(NSString *)key; @end biococoa-2.2.2/BCFoundation/BCGeneExpression/BCSample.m000644 000765 000024 00000006636 11223237412 023227 0ustar00scottcstaff000000 000000 // // BCSample.m // BioCocoa // // Created by Scott Christley on 10/07/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCSample.h" // Global list of all samples static NSMutableDictionary *samples = nil; static NSMutableDictionary *get_all_samples() { if (!samples) { samples = [NSMutableDictionary new]; } return samples; } @implementation BCSample // Access global list of samples + (NSDictionary *)getAllSamples { return [NSDictionary dictionaryWithDictionary: get_all_samples()]; } + (BCSample *)sampleWithId: (NSString *)anId { NSDictionary *d = get_all_samples(); return [d objectForKey: anId]; } + (void)addSample: (BCSample *)aSample { NSString *id = [aSample getId]; NSMutableDictionary *d = get_all_samples(); [d setObject: aSample forKey: id]; } // Default constructor - initWithId: (NSString *)anId { self = [super init]; if (self) { attributes = [NSMutableDictionary new]; [attributes setObject: anId forKey: @"id"]; } return self; } // Accessor methods - (NSString *)getId { return [attributes objectForKey: @"id"]; } - (id)valueForKey: (NSString *)aKey { id aValue = [attributes objectForKey: aKey]; if ((aValue) && ([aValue isKindOfClass: [NSArray class]])) { if ([aValue count] == 0) return nil; else return [aValue objectAtIndex: 0]; } return aValue; } - (NSArray *)valuesForKey: (NSString *)aKey { id aValue = [attributes objectForKey: aKey]; if (!aValue) return [NSArray array]; if ([aValue isKindOfClass: [NSArray class]]) { return aValue; } else return [NSArray arrayWithObject: aValue]; } - (void)setValue:(id)aValue forKey:(NSString *)aKey { id anEntry = [attributes objectForKey: aKey]; if (!anEntry) [attributes setObject: aValue forKey: aKey]; else { if ([anEntry isKindOfClass: [NSArray class]]) { [anEntry addObject: aValue]; } else { NSMutableArray *a = [NSMutableArray arrayWithObject: anEntry]; [a addObject: aValue]; [attributes setObject: a forKey: aKey]; } } } @end biococoa-2.2.2/BCFoundation/BCGeneExpression/BCSeries.h000644 000765 000024 00000004533 11223237412 023225 0ustar00scottcstaff000000 000000 // // BCSeries.h // BioCocoa // // Created by Scott Christley on 10/07/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Gene expression series. */ #import // For drag/drop #define BCSeriesDataType @"BCSeriesDataType" @interface BCSeries : NSObject { NSMutableDictionary *attributes; BOOL isLoaded; } // Access global list of series + (NSDictionary *)getAllSeries; + (BCSeries *)seriesWithId: (NSString *)anId; + (void)addSeries: (BCSeries *)aSeries; + (NSSet *)keysForSeries: (NSArray *)seriesList withInternalKeys: (BOOL)flag; // Default constructor - initWithId: (NSString *)anId; - loadIfNecessary; // Accessor methods - (NSString *)getId; - (id)valueForKey: (NSString *)aKey; - (NSArray *)valuesForKey: (NSString *)aKey; - (void)setValue:(id)value forKey:(NSString *)key; - (NSArray *)allKeys; - (BOOL)isLoaded; - (NSString *)seriesDescription; - (NSString *)seriesHTMLDescription; @end biococoa-2.2.2/BCFoundation/BCGeneExpression/BCSeries.m000644 000765 000024 00000022513 11223237412 023230 0ustar00scottcstaff000000 000000 // // BCSeries.m // BioCocoa // // Created by Scott Christley on 10/11/06. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // #import "BCSeries.h" #import "BCPreferences.h" #import "BCParseSOFT.h" // Global list of series static NSMutableDictionary *series = nil; static NSMutableDictionary *get_all_series() { if (!series) { series = [NSMutableDictionary new]; NSString *aString = [BCPreferences sharedDataSubdirectory: @"GeneExpression"]; if (aString) { NSArray *anArray = [[NSFileManager defaultManager] directoryContentsAtPath: aString]; if ([anArray count] > 0) { int i; //printf("%s\n", [[anArray description] UTF8String]); for (i = 0; i < [anArray count]; ++i) { NSString *fileName = [anArray objectAtIndex: i]; NSRange r = [fileName rangeOfString: @"GSE"]; if (r.location == 0) { r = [fileName rangeOfString: @"_"]; r.length = r.location; r.location = 0; NSString *anId = [fileName substringWithRange: r]; //printf("%s\n", [anId UTF8String]); BCSeries *aSeries = [[BCSeries alloc] initWithId: anId]; [aSeries setValue: fileName forKey: @"Data File"]; [series setObject: aSeries forKey: anId]; } } } } } return series; } static NSMutableArray *internalKeys = nil; static NSMutableArray *get_internal_keys() { if (!internalKeys) { internalKeys = [NSMutableArray new]; [internalKeys addObject: @"id"]; [internalKeys addObject: @"Data File"]; } return internalKeys; } @implementation BCSeries // Access global list of series + (NSDictionary *)getAllSeries { return [NSDictionary dictionaryWithDictionary: get_all_series()]; } + (BCSeries *)seriesWithId: (NSString *)anId { NSDictionary *d = get_all_series(); return [d objectForKey: anId]; } + (void)addSeries: (BCSeries *)aSeries { NSString *anId = [aSeries getId]; NSMutableDictionary *d = get_all_series(); [d setObject: aSeries forKey: anId]; } + (NSSet *)keysForSeries: (NSArray *)seriesList withInternalKeys: (BOOL)flag { if (!seriesList) return [NSSet set]; NSMutableSet *theKeys = [NSMutableSet set]; NSArray *iKeys; if (!flag) iKeys = get_internal_keys(); int i; for (i = 0; i < [seriesList count]; ++i) { BCSeries *aSeries = [seriesList objectAtIndex: i]; NSArray *a = [aSeries allKeys]; if (!flag) { a = [NSMutableArray arrayWithArray: a]; [(NSMutableArray *)a removeObjectsInArray: iKeys]; } [theKeys addObjectsFromArray: a]; } return [NSSet setWithSet: theKeys]; } // Default constructor - initWithId: (NSString *)anId { self = [super init]; if (self) { attributes = [NSMutableDictionary new]; [attributes setObject: anId forKey: @"id"]; isLoaded = NO; } return self; } - loadIfNecessary { if (isLoaded) return self; NSString *aString = [BCPreferences sharedDataSubdirectory: @"GeneExpression"]; NSMutableString *fileName = [NSMutableString stringWithString: aString]; [fileName appendString: @"/"]; [fileName appendString: [self getId]]; [fileName appendString: @"_family.soft"]; BCParseSOFT *parser = [BCParseSOFT new]; if ([parser parseFile: fileName]) isLoaded = YES; [parser release]; return self; } // Accessor methods - (NSString *)getId { return [attributes objectForKey: @"id"]; } - (id)valueForKey: (NSString *)aKey { id aValue = [attributes objectForKey: aKey]; if ((aValue) && ([aValue isKindOfClass: [NSArray class]])) { if ([aValue count] == 0) return nil; else return [aValue objectAtIndex: 0]; } return aValue; } - (NSArray *)valuesForKey: (NSString *)aKey { id aValue = [attributes objectForKey: aKey]; if (!aValue) return [NSArray array]; if ([aValue isKindOfClass: [NSArray class]]) { return aValue; } else return [NSArray arrayWithObject: aValue]; } - (void)setValue:(id)aValue forKey:(NSString *)aKey { id anEntry = [attributes objectForKey: aKey]; if (!anEntry) [attributes setObject: aValue forKey: aKey]; else { if ([anEntry isKindOfClass: [NSArray class]]) { [anEntry addObject: aValue]; } else { NSMutableArray *a = [NSMutableArray arrayWithObject: anEntry]; [a addObject: aValue]; [attributes setObject: a forKey: aKey]; } } } - (NSArray *)allKeys { return [attributes allKeys]; } - (BOOL)isLoaded { return isLoaded; } // // // - (NSString *)seriesDescription { int i; NSArray *a; NSString *v; NSMutableString *s = [NSMutableString string]; [s appendString: @"Series: "]; [s appendString: [self getId]]; [s appendString: @"\n"]; if (!isLoaded) return s; v = [self valueForKey: @"Series_title"]; if (v) [s appendString: v]; v = [self valueForKey: @"Series_status"]; if (v) { [s appendString: @"\n\nStatus: "]; [s appendString: v]; } v = [self valueForKey: @"Series_submission_date"]; if (v) { [s appendString: @"\nSubmission: "]; [s appendString: v]; } v = [self valueForKey: @"Series_last_update_date"]; if (v) { [s appendString: @"\nLast Update: "]; [s appendString: v]; } v = [self valueForKey: @"Series_pubmed_id"]; if (v) { [s appendString: @"\nPubmed: http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&term="]; [s appendString: v]; } v = [self valueForKey: @"Series_type"]; if (v) { [s appendString: @"\nType: "]; [s appendString: v]; } [s appendString: @"\n\nSummary:\n"]; a = [self valuesForKey: @"Series_summary"]; for (i = 0; i < [a count]; ++i) { [s appendString: @"\t"]; [s appendString: [a objectAtIndex: i]]; [s appendString: @"\n"]; } v = [self valueForKey: @"Series_overall_design"]; if (v) { [s appendString: @"\nOverall Design:\n"]; [s appendString: v]; } [s appendString: @"\n\nContact:\n"]; v = [self valueForKey: @"Series_contact_name"]; if (v) { [s appendString: v]; [s appendString: @"\n"]; } v = [self valueForKey: @"Series_contact_email"]; if (v) { [s appendString: v]; [s appendString: @"\n"]; } v = [self valueForKey: @"Series_contact_laboratory"]; if (v) { [s appendString: v]; [s appendString: @"\n"]; } v = [self valueForKey: @"Series_contact_department"]; if (v) { [s appendString: v]; [s appendString: @"\n"]; } v = [self valueForKey: @"Series_contact_institute"]; if (v) { [s appendString: v]; [s appendString: @"\n"]; } v = [self valueForKey: @"Series_contact_address"]; if (v) { [s appendString: v]; [s appendString: @"\n"]; } v = [self valueForKey: @"Series_contact_city"]; if (v) { [s appendString: v]; [s appendString: @"\n"]; } v = [self valueForKey: @"Series_contact_zip/postal_code"]; if (v) { [s appendString: v]; [s appendString: @"\n"]; } v = [self valueForKey: @"Series_contact_country"]; if (v) { [s appendString: v]; [s appendString: @"\n"]; } [s appendString: @"\nPlatforms:\n"]; a = [self valuesForKey: @"Series_platform_id"]; for (i = 0; i < [a count]; ++i) { [s appendString: [a objectAtIndex: i]]; [s appendString: @"\n"]; } [s appendString: @"\nSamples:\n"]; a = [self valuesForKey: @"Series_sample_id"]; for (i = 0; i < [a count]; ++i) { [s appendString: [a objectAtIndex: i]]; [s appendString: @"\n"]; } return s; } - (NSString *)seriesHTMLDescription { //int i; //NSArray *a; NSString *v; NSMutableString *s = [NSMutableString string]; [s appendString: @"\n"]; [s appendString: @"\n"]; [s appendString: @"Series: "]; [s appendString: [self getId]]; [s appendString: @"
"]; if (!isLoaded) goto done; v = [self valueForKey: @"Series_pubmed_id"]; if (v) { [s appendString: @"Pubmed: "]; [s appendString: v]; [s appendString: @"
"]; } done: [s appendString: @"\n"]; [s appendString: @"\n"]; return s; } @end biococoa-2.2.2/BCFoundation/BCGeneExpression/GNUmakefile000644 000765 000024 00000003767 11255506261 023505 0ustar00scottcstaff000000 000000 # # GNUmakefile # # Written by: Scott Christley # Copyright (c) 2003-2009 The BioCocoa Project. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # include $(GNUSTEP_MAKEFILES)/common.make # The library to be compiled SUBPROJECT_NAME = BCGeneExpression # The Objective-C source files to be compiled BCGeneExpression_OBJC_FILES = \ BCSeries.m \ BCSample.m \ BCPlatform.m \ BCParseSOFT.m # The header files BCGeneExpression_HEADER_FILES = \ BCSeries.h \ BCSample.h \ BCPlatform.h \ BCParseSOFT.h BIOCOCOA_BASE_DIR = .. -include $(BIOCOCOA_BASE_DIR)/GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble biococoa-2.2.2/BCFoundation/BCAnalysis/BCMCP.h000644 000765 000024 00000005270 11223237412 021236 0ustar00scottcstaff000000 000000 // // BCMCP.h // BioCocoa // // Created by Scott Christley on 7/24/07. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import @class BCSuffixArray; @class BCSequenceArray; @class BCCachedSequenceFile; @interface BCMCP : NSObject { NSMutableDictionary *metaDict; NSMutableArray *sequenceToMeta; BOOL inMemory; // in memory sequences BCSequenceArray *sequenceArray; BCSequenceArray *reverseComplementArray; // cached sequences NSMutableArray *cachedFiles; } + (BOOL)mcpToFile:(NSString *)aPath suffixArray:(BCSuffixArray *)oneArray withSuffixArray:(BCSuffixArray *)otherArray lowerBound:(int)lowerBound; - (BOOL)intersectToFile:(NSString *)aPath withMCP:(BCMCP *)anMCP; - (BOOL)unionToFile:(NSString *)aPath withMCP:(BCMCP *)anMCP; - (BOOL)trimToFile:(NSString *)aPath; - initWithContentsOfFile:(NSString *)aPath inMemory:(BOOL)aFlag; - (BOOL)isInMemory; - (BCSequenceArray *)sequenceArray; - (BCSequenceArray *)reverseComplementArray; - (NSDictionary *)metaDictionary; - (NSArray *)sequenceToMeta; - (NSArray *)cachedFiles; - (BOOL)writeToFile:(NSString *)aPath; - (FILE *)getFILE; - (void)summaryFormatWithMinimumLength:(int)minLength; - (void)fastaFormatWithMinimumLength:(int)minLength; - (void)tableFormatWithMinimumLength:(int)minLength; @end biococoa-2.2.2/BCFoundation/BCAnalysis/BCMCP.m000644 000765 000024 00000174374 11455660036 021270 0ustar00scottcstaff000000 000000 // // BCMCP.m // BioCocoa // // Created by Scott Christley on 7/24/07. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCMCP.h" #import "BCSuffixArray.h" #import "BCSequence.h" #import "BCSequenceArray.h" #import "BCSequenceReader.h" #import "BCCachedSequenceFile.h" #import "BCSymbolSet.h" #define SEQ_IN_MEM 1 // helper class @interface MCPNode : NSObject { @public int maxCnt; int numFiles; int *file; NSRange *sequence; } - initWithMCPLength: (int)num; - (NSComparisonResult)lengthCompare:(MCPNode *)anObject; @end static void insert_range(NSMutableArray *a, MCPNode *aNode, NSDictionary *metaDict); @implementation BCMCP + (BOOL)mcpToFile:(NSString *)aPath suffixArray:(BCSuffixArray *)oneArray withSuffixArray:(BCSuffixArray *)otherArray lowerBound:(int)lowerBound { BOOL isNucleotide = YES; int i; FILE *sa1 = [oneArray getFILE]; BCSequenceArray *sa1Seqs = [oneArray sequenceArray]; BCSequenceArray *sa1Revs = [oneArray reverseComplementArray]; int sa1Cnt = [sa1Seqs count]; unsigned char *seqMem1[sa1Cnt]; unsigned char *revMem1[sa1Cnt]; int seqLen1[sa1Cnt]; unsigned char *seqMemPos1[sa1Cnt]; FILE *sa2 = [otherArray getFILE]; BCSequenceArray *sa2Seqs = [otherArray sequenceArray]; BCSequenceArray *sa2Revs = [otherArray reverseComplementArray]; int sa2Cnt = [sa2Seqs count]; unsigned char *seqMem2[sa2Cnt]; unsigned char *revMem2[sa2Cnt]; int seqLen2[sa2Cnt]; unsigned char *seqMemPos2[sa2Cnt]; NSMutableArray *seqFiles = [NSMutableArray array]; NSMutableDictionary *seq1Dict = [NSMutableDictionary dictionaryWithDictionary: [oneArray metaDictionary]]; NSMutableDictionary *seq2Dict = [NSMutableDictionary dictionaryWithDictionary: [otherArray metaDictionary]]; [seqFiles addObject: seq1Dict]; [seqFiles addObject: seq2Dict]; for (i = 0; i < sa1Cnt; ++i) { BCSequence *aSeq = [sa1Seqs sequenceAtIndex: i]; BCSequence *revSeq = [sa1Revs sequenceAtIndex: i]; seqMem1[i] = (unsigned char *)[[aSeq sequenceData] bytes]; revMem1[i] = (unsigned char *)[[revSeq sequenceData] bytes]; seqLen1[i] = [aSeq length]; //seqMemPos1[i] = seqMem1[i]; } #if 0 // Eliminate duplicate file names int mapSeqs[sa2Cnt]; int totCnt = sa1Cnt; for (i = 0; i < sa2Cnt; ++i) { NSString *s = [sa2Seqs objectAtIndex: i]; unsigned idx = [sa1Seqs indexOfObject: s]; if (idx == NSNotFound) { mapSeqs[i] = totCnt; ++totCnt; } else mapSeqs[i] = idx; } #else int mapSeqs[sa2Cnt]; int totCnt = sa1Cnt; NSArray *a = [seq2Dict objectForKey: @"sequences"]; for (i = 0; i < sa2Cnt; ++i) { NSMutableDictionary *d = [a objectAtIndex: i]; [d setObject: [NSNumber numberWithInt: totCnt] forKey: @"number"]; mapSeqs[i] = totCnt; ++totCnt; } #endif printf("%d total unique sequence files.\n", totCnt); for (i = 0; i < sa2Cnt; ++i) { BCSequence *aSeq = [sa2Seqs sequenceAtIndex: i]; BCSequence *revSeq = [sa2Revs sequenceAtIndex: i]; seqMem2[i] = (unsigned char *)[[aSeq sequenceData] bytes]; revMem2[i] = (unsigned char *)[[revSeq sequenceData] bytes]; seqLen2[i] = [aSeq length]; //seqMemPos2[i] = seqMem2[i]; } // open output mcp file NSString *aString = [aPath stringByAppendingPathExtension: @"mcp"]; FILE *sa3 = fopen([aString UTF8String], "w"); if (!sa3) { NSLog(@"Could not open output file: %@\n", aString); return NO; } // meta mcp file NSString *metaFile = [aPath stringByAppendingPathExtension: @"meta_mcp"]; NSMutableDictionary *mDict = [NSMutableDictionary dictionary]; [mDict setObject: aString forKey: @"mcp file"]; [mDict setObject: seqFiles forKey: @"sequence files"]; [mDict setObject: [NSNumber numberWithInt: lowerBound] forKey: @"lower bound"]; [mDict writeToFile: metaFile atomically: YES]; #if 0 fprintf(sa3, "%d\n", totCnt); for (i = 0; i < sa1Cnt; ++i) fprintf(sa3, "%s\n", [[sa1Seqs objectAtIndex: i] UTF8String]); for (i = 0; i < sa2Cnt; ++i) { if (mapSeqs[i] >= sa1Cnt) fprintf(sa3, "%s\n", [[sa2Seqs objectAtIndex: i] UTF8String]); } #endif // find the maximum common prefix int sa1Offset, sa1File; fread(&sa1Offset, sizeof(int), 1, sa1); fread(&sa1File, sizeof(int), 1, sa1); int sa2Offset, sa2File; fread(&sa2Offset, sizeof(int), 1, sa2); fread(&sa2File, sizeof(int), 1, sa2); fpos_t sa2Pos; fgetpos(sa2, &sa2Pos); do { BOOL finish = NO; BOOL eofFlag = NO; BOOL firstMatch = YES; while (!finish) { //printf("offset: %d file: %s\n", sa1Offset, // [[sa1Seqs objectAtIndex: sa1File] UTF8String]); //printf("offset: %d file: %s\n", sa2Offset, // [[sa2Seqs objectAtIndex: sa2File] UTF8String]); BOOL done = NO; int nextMax = 0; #if SEQ_IN_MEM if (sa1Offset < seqLen1[sa1File]) { // forward strand seqMemPos1[sa1File] = seqMem1[sa1File] + sa1Offset; } else { // reverse strand seqMemPos1[sa1File] = revMem1[sa1File] + sa1Offset - seqLen1[sa1File]; } if (sa2Offset < seqLen2[sa2File]) { // forward strand seqMemPos2[sa2File] = seqMem2[sa2File] + sa2Offset; } else { // reverse strand seqMemPos2[sa2File] = revMem2[sa2File] + sa2Offset - seqLen2[sa2File]; } #else fseek(seq1[sa1File], sa1Offset, SEEK_SET); fseek(seq2[sa2File], sa2Offset, SEEK_SET); #endif // get common prefix for two sequences int sa1Len = 0, sa2Len = 0; BOOL is2Greater = NO; BOOL eof2Flag = NO; while (!done) { char c1, c2; #if SEQ_IN_MEM // check end-of-sequence conditions if (sa1Offset < seqLen1[sa1File]) { // forward strand if ((sa1Offset + sa1Len) >= seqLen1[sa1File]) { done = YES; eofFlag = YES; } } else { // reverse strand if ((sa1Offset + sa1Len) >= (2*seqLen1[sa1File])) { done = YES; eofFlag = YES; } } // check end-of-sequence conditions if (sa2Offset < seqLen2[sa2File]) { // forward strand if ((sa2Offset + sa2Len) >= seqLen2[sa2File]) { done = YES; eof2Flag = YES; } } else { // reverse strand if ((sa2Offset + sa2Len) >= (2*seqLen2[sa2File])) { done = YES; eof2Flag = YES; } } if (done) continue; c1 = *(seqMemPos1[sa1File] + sa1Len); ++sa1Len; c2 = *(seqMemPos2[sa2File] + sa2Len); ++sa2Len; #else fread(&c1, sizeof(char), 1, seq1[sa1File]); fread(&c2, sizeof(char), 1, seq2[sa2File]); // check EOF conditions if (feof(seq1[sa1File])) { // EOF for first sequence done = YES; eofFlag = YES; continue; } if (feof(seq2[sa2File])) { // EOF for second sequence done = YES; eof2Flag = YES; continue; } #endif // if comparing the same sequence against itself // skip the obvious self match at the same positions if ((sa1File == mapSeqs[sa2File]) && (sa1Offset == sa2Offset)) { done = YES; continue; } //printf("c1: %c c2: %c\n", c1, c2); // handle case c1 = toupper(c1); c2 = toupper(c2); // do not look beyond valid letters if (isNucleotide) { if ((c1 != 'A') && (c1 != 'C') && (c1 != 'G') && (c1 != 'T')) { done = YES; eofFlag = YES; } if ((c2 != 'A') && (c2 != 'C') && (c2 != 'G') && (c2 != 'T')) { done = YES; eof2Flag = YES; } } else { if (c1 == BCSUFFIXARRAY_TERM_CHAR) { done = YES; eofFlag = YES; } if (c2 == BCSUFFIXARRAY_TERM_CHAR) { done = YES; eof2Flag = YES; } } if (done) continue; if (c1 == c2) { ++nextMax; continue; } else { if (c2 > c1) is2Greater = YES; done = YES; } } // if end of suffix array 2, nothing more to check // so move suffix array 1 forward if (feof(sa2)) { eofFlag = YES; nextMax = 0; } if (nextMax >= lowerBound) { //printf("write mcp: %d sa1: %d sa2: %d\n", nextMax, sa1Offset, sa2Offset); // write out mcp int numFiles = 2; fwrite(&nextMax, sizeof(int), 1, sa3); fwrite(&numFiles, sizeof(int), 1, sa3); fwrite(&sa1Offset, sizeof(int), 1, sa3); fwrite(&sa1File, sizeof(int), 1, sa3); fwrite(&sa2Offset, sizeof(int), 1, sa3); int currentFile = mapSeqs[sa2File]; fwrite(¤tFile, sizeof(int), 1, sa3); if (firstMatch) { fgetpos(sa2, &sa2Pos); firstMatch = NO; } // next sequence fread(&sa2Offset, sizeof(int), 1, sa2); fread(&sa2File, sizeof(int), 1, sa2); } else { // no match so move forward // determine which to move forward // EOS1 and EOS2 -> sa1 // EOS1 and too short -> sa1 // too short and EOS2 -> sa2 // too short and too short -> if is2Greater then sa1 else sa2 BOOL sa1Move = NO; if (eofFlag) sa1Move = YES; else if ((!eof2Flag) && (is2Greater)) sa1Move = YES; if (sa1Move) { //printf("too short: %d moving sa1: %d\n", nextMax, sa1Offset); // next sequence fread(&sa1Offset, sizeof(int), 1, sa1); fread(&sa1File, sizeof(int), 1, sa1); // backtrack fsetpos(sa2, &sa2Pos); fseek(sa2, -2 * sizeof(int), SEEK_CUR); fread(&sa2Offset, sizeof(int), 1, sa2); fread(&sa2File, sizeof(int), 1, sa2); finish = YES; } else { //printf("too short: %d moving sa2: %d\n", nextMax, sa2Offset); // next sequence fread(&sa2Offset, sizeof(int), 1, sa2); fread(&sa2File, sizeof(int), 1, sa2); // move forward in suffix array 2 // so long as lexically less if ((firstMatch) && (!is2Greater)) { fgetpos(sa2, &sa2Pos); } } } } } while (!feof(sa1)); fclose(sa1); fclose(sa2); fclose(sa3); return YES; } - (BOOL)intersectToFile:(NSString *)aPath withMCP:(BCMCP *)anMCP { BOOL isNucleotide = YES; int i, j; int mallocLength1 = 10000, mallocLength2 = 10000; char *seqBuffer1 = (char *)malloc(mallocLength1); char *seqBuffer2 = (char *)malloc(mallocLength2); FILE *mcp1 = [self getFILE]; NSArray *seqFiles1 = [metaDict objectForKey: @"sequence files"]; int lb1 = [[metaDict objectForKey: @"lower bound"] intValue]; int mcp1Cnt = [[[[[seqFiles1 lastObject] objectForKey: @"sequences"] lastObject] objectForKey: @"number"] intValue] + 1; FILE *mcp2 = [anMCP getFILE]; NSDictionary *metaDict2 = [anMCP metaDictionary]; int lb2 = [[metaDict2 objectForKey: @"lower bound"] intValue]; NSArray *sequenceToMeta2 = [anMCP sequenceToMeta]; NSArray *cachedFiles2 = [anMCP cachedFiles]; NSArray *seqFiles2 = [metaDict2 objectForKey: @"sequence files"]; int mcp2Cnt = [[[[[seqFiles2 lastObject] objectForKey: @"sequences"] lastObject] objectForKey: @"number"] intValue] + 1; // have to take larger for lower bound int lowerBound; if (lb1 > lb2) lowerBound = lb1; else lowerBound = lb2; // Eliminate duplicate sequence files NSFileManager *fileManager = [NSFileManager defaultManager]; NSMutableArray *seqFiles3 = [NSMutableArray arrayWithArray: seqFiles1]; int mapSeqs[mcp2Cnt]; int mapCnt = 0; int totCnt = mcp1Cnt; for (i = 0; i < [seqFiles2 count]; ++i) { NSDictionary *d1 = [seqFiles2 objectAtIndex: i]; NSString *s1 = [d1 objectForKey: @"sequences file"]; NSDictionary *fileAttr = [fileManager fileAttributesAtPath: s1 traverseLink: YES]; NSNumber *fn1 = [fileAttr objectForKey: NSFileSystemFileNumber]; BOOL found = NO; int foundMap = 0; for (j = 0; j < [seqFiles1 count]; ++j) { NSDictionary *d2 = [seqFiles3 objectAtIndex: j]; NSString *s2 = [d2 objectForKey: @"sequences file"]; fileAttr = [fileManager fileAttributesAtPath: s2 traverseLink: YES]; NSNumber *fn2 = [fileAttr objectForKey: NSFileSystemFileNumber]; if ([fn1 isEqualToNumber: fn2]) { found = YES; foundMap = j; break; } } if (!found) { NSMutableDictionary *newDict = [NSMutableDictionary dictionaryWithDictionary: d1]; NSArray *oldArray = [newDict objectForKey: @"sequences"]; NSMutableArray *newArray = [NSMutableArray array]; for (j = 0; j < [oldArray count]; ++j) { mapSeqs[mapCnt] = totCnt; NSMutableDictionary *seqDict = [NSMutableDictionary dictionaryWithDictionary: [oldArray objectAtIndex: j]]; [seqDict setObject: [NSNumber numberWithInt: totCnt] forKey: @"number"]; [newArray addObject: seqDict]; ++mapCnt; ++totCnt; } [newDict setObject: newArray forKey: @"sequences"]; [seqFiles3 addObject: newDict]; } else { NSDictionary *d2 = [seqFiles3 objectAtIndex: foundMap]; NSArray *oldArray = [d2 objectForKey: @"sequences"]; for (j = 0; j < [oldArray count]; ++j) { mapSeqs[mapCnt] = foundMap + j; ++mapCnt; } } } printf("%d total unique sequence files.\n", totCnt); // open output mcp file NSString *aString = [aPath stringByAppendingPathExtension: @"mcp"]; FILE *mcp3 = fopen([aString UTF8String], "w"); if (!mcp3) { NSLog(@"Could not open file: %@\n", aString); fclose(mcp1); fclose(mcp2); free(seqBuffer1); free(seqBuffer2); return NO; } // meta mcp file NSString *metaFile = [aPath stringByAppendingPathExtension: @"meta_mcp"]; NSMutableDictionary *metaDict3 = [NSMutableDictionary dictionary]; [metaDict3 setObject: aString forKey: @"mcp file"]; [metaDict3 setObject: seqFiles3 forKey: @"sequence files"]; [metaDict3 setObject: [NSNumber numberWithInt: lowerBound] forKey: @"lower bound"]; [metaDict3 writeToFile: metaFile atomically: YES]; // intersect the maximum common prefix int mcp1Length, mcp1NumFiles; int mcp1File[totCnt], mcp1Offset[totCnt]; fread(&mcp1Length, sizeof(int), 1, mcp1); fread(&mcp1NumFiles, sizeof(int), 1, mcp1); for (i = 0; i < mcp1NumFiles; ++i) { fread(&(mcp1Offset[i]), sizeof(int), 1, mcp1); fread(&(mcp1File[i]), sizeof(int), 1, mcp1); } int mcp1Index, seq1Start, mcp1SeqIndex, seq1Len = 0; BCCachedSequenceFile *cacheFile1; NSArray *mcp1Seqs; if (!feof(mcp1)) { mcp1Index = [[sequenceToMeta objectAtIndex: mcp1File[0]] intValue]; cacheFile1 = [cachedFiles objectAtIndex: mcp1Index]; mcp1Seqs = [[seqFiles1 objectAtIndex: mcp1Index] objectForKey: @"sequences"]; seq1Start = [[[mcp1Seqs objectAtIndex: 0] objectForKey: @"number"] intValue]; mcp1SeqIndex = mcp1File[0] - seq1Start; seq1Len = [[[mcp1Seqs objectAtIndex: mcp1SeqIndex] objectForKey: @"length"] intValue]; if (mcp1Length > mallocLength1) { mallocLength1 = mcp1Length; free(seqBuffer1); seqBuffer1 = malloc(mallocLength1); } [cacheFile1 symbols: seqBuffer1 atPosition: mcp1Offset[0] ofLength: mcp1Length forSequenceNumber: mcp1SeqIndex]; } int mcp2Length, mcp2NumFiles; int mcp2File[totCnt], mcp2Offset[totCnt]; fpos_t mcp2Pos; fgetpos(mcp2, &mcp2Pos); fread(&mcp2Length, sizeof(int), 1, mcp2); fread(&mcp2NumFiles, sizeof(int), 1, mcp2); for (i = 0; i < mcp2NumFiles; ++i) { fread(&(mcp2Offset[i]), sizeof(int), 1, mcp2); fread(&(mcp2File[i]), sizeof(int), 1, mcp2); } int mcp2Index, seq2Start, mcp2SeqIndex, seq2Len = 0; BCCachedSequenceFile *cacheFile2; NSArray *mcp2Seqs; if (!feof(mcp2)) { mcp2Index = [[sequenceToMeta2 objectAtIndex: mcp2File[0]] intValue]; cacheFile2 = [cachedFiles2 objectAtIndex: mcp2Index]; mcp2Seqs = [[seqFiles2 objectAtIndex: mcp2Index] objectForKey: @"sequences"]; seq2Start = [[[mcp2Seqs objectAtIndex: 0] objectForKey: @"number"] intValue]; mcp2SeqIndex = mcp2File[0] - seq2Start; seq2Len = [[[mcp2Seqs objectAtIndex: mcp2SeqIndex] objectForKey: @"length"] intValue]; if (mcp2Length > mallocLength2) { mallocLength2 = mcp2Length; free(seqBuffer2); seqBuffer2 = malloc(mallocLength2); } [cacheFile2 symbols: seqBuffer2 atPosition: mcp2Offset[0] ofLength: mcp2Length forSequenceNumber: mcp2SeqIndex]; } while (!feof(mcp1)) { if (feof(mcp2)) break; BOOL finish = NO; BOOL eofFlag = NO; BOOL firstMatch = YES; while (!finish) { //printf("offset: %d file: %s\n", mcp1Offset[0], // [[mcp1Seqs objectAtIndex: mcp1File[0]] UTF8String]); //printf("offset: %d file: %s\n", mcp2Offset[0], // [[mcp2Seqs objectAtIndex: mcp2File[0]] UTF8String]); BOOL done = NO; int nextMax = 0; #if 0 fseek(seq1[mcp1File[0]], mcp1Offset[0], SEEK_SET); fseek(seq2[mcp2File[0]], mcp2Offset[0], SEEK_SET); #endif // get common prefix for two sequences int mcp1Len = 0, mcp2Len = 0; BOOL is2Greater = NO; BOOL eof2Flag = NO; while (!done) { // check end-of-sequence conditions if (mcp1Offset[0] < seq1Len) { // forward strand if ((mcp1Offset[0] + mcp1Len) >= seq1Len) { done = YES; eofFlag = YES; } } else { // reverse strand if ((mcp1Offset[0] + mcp1Len) >= (2*seq1Len)) { done = YES; eofFlag = YES; } } // check end-of-sequence conditions if (mcp2Offset[0] < seq2Len) { // forward strand if ((mcp2Offset[0] + mcp2Len) >= seq2Len) { done = YES; eof2Flag = YES; } } else { // reverse strand if ((mcp2Offset[0] + mcp2Len) >= (2*seq2Len)) { done = YES; eof2Flag = YES; } } // cannot go past the length of the mcp if (nextMax == mcp1Length) { // end of first sequence done = YES; eofFlag = YES; } if (nextMax == mcp2Length) { // end of second sequence done = YES; eof2Flag = YES; } if (done) continue; char c1, c2; //c1 = [cacheFile1 symbolAtPosition: (mcp1Offset[0] + mcp1Len) forSequenceNumber: mcp1SeqIndex]; c1 = seqBuffer1[mcp1Len]; ++mcp1Len; //c2 = [cacheFile2 symbolAtPosition: (mcp2Offset[0] + mcp2Len) forSequenceNumber: mcp2SeqIndex]; c2 = seqBuffer2[mcp2Len]; ++mcp2Len; //printf("c1: %c c2: %c\n", c1, c2); // handle case c1 = toupper(c1); c2 = toupper(c2); // do not look beyond valid letters if (isNucleotide) { if ((c1 != 'A') && (c1 != 'C') && (c1 != 'G') && (c1 != 'T')) { done = YES; eofFlag = YES; } if ((c2 != 'A') && (c2 != 'C') && (c2 != 'G') && (c2 != 'T')) { done = YES; eof2Flag = YES; } } else { if (c1 == BCSUFFIXARRAY_TERM_CHAR) { done = YES; eofFlag = YES; } if (c2 == BCSUFFIXARRAY_TERM_CHAR) { done = YES; eof2Flag = YES; } } if (done) continue; if (c1 == c2) { ++nextMax; continue; } else { if (c2 > c1) is2Greater = YES; done = YES; } } // if end of mcp 2, nothing more to check // so move mcp 1 forward if (feof(mcp2)) { eofFlag = YES; nextMax = 0; //printf("EOF for mcp2\n"); } BOOL read1Flag = NO; BOOL read2Flag = NO; BOOL getNewPos = NO; if (nextMax >= lowerBound) { //printf("write mcp: %d mcp1: (%d, %d) mcp2: (%d, %d)\n", nextMax, mcp1Offset[0], mcp1Offset[1], mcp2Offset[0], mcp2Offset[1]); // determine unique sequence references int fileCnt = mcp1NumFiles; for (j = 0; j < mcp2NumFiles; ++j) if (mapSeqs[mcp2File[j]] >= mcp1Cnt) ++fileCnt; // write mcp fwrite(&nextMax, sizeof(int), 1, mcp3); fwrite(&fileCnt, sizeof(int), 1, mcp3); for (j = 0; j < mcp1NumFiles; ++j) { fwrite(&mcp1Offset[j], sizeof(int), 1, mcp3); fwrite(&mcp1File[j], sizeof(int), 1, mcp3); } for (j = 0; j < mcp2NumFiles; ++j) { if (mapSeqs[mcp2File[j]] >= mcp1Cnt) { int fileNum = mapSeqs[mcp2File[j]]; fwrite(&mcp2Offset[j], sizeof(int), 1, mcp3); fwrite(&fileNum, sizeof(int), 1, mcp3); } } if (firstMatch) { //fgetpos(mcp2, &mcp2Pos); firstMatch = NO; } // next sequence read2Flag = YES; } else { // no match so move forward // determine which to move forward // EOS1 and EOS2 -> mcp1 // EOS1 and too short -> mcp1 // too short and EOS2 -> mcp2 // too short and too short -> if is2Greater then mcp1 else mcp2 BOOL mcp1Move = NO; if (eofFlag) mcp1Move = YES; else if ((!eof2Flag) && (is2Greater)) mcp1Move = YES; if (mcp1Move) { //printf("too short: %d moving mcp1: %d\n", nextMax, mcp1Offset[0]); // next sequence read1Flag = YES; // backtrack fsetpos(mcp2, &mcp2Pos); read2Flag = YES; finish = YES; } else { //printf("too short: %d moving mcp2: %d\n", nextMax, mcp2Offset[0]); // next sequence read2Flag = YES; // move forward in mcp 2 // so long as lexically less if ((firstMatch) && (!is2Greater)) { getNewPos = YES; } } } // next sequence if (read1Flag) { fread(&mcp1Length, sizeof(int), 1, mcp1); fread(&mcp1NumFiles, sizeof(int), 1, mcp1); for (i = 0; i < mcp1NumFiles; ++i) { fread(&(mcp1Offset[i]), sizeof(int), 1, mcp1); fread(&(mcp1File[i]), sizeof(int), 1, mcp1); } mcp1Index = [[sequenceToMeta objectAtIndex: mcp1File[0]] intValue]; cacheFile1 = [cachedFiles objectAtIndex: mcp1Index]; mcp1Seqs = [[seqFiles1 objectAtIndex: mcp1Index] objectForKey: @"sequences"]; seq1Start = [[[mcp1Seqs objectAtIndex: 0] objectForKey: @"number"] intValue]; mcp1SeqIndex = mcp1File[0] - seq1Start; seq1Len = [[[mcp1Seqs objectAtIndex: mcp1SeqIndex] objectForKey: @"length"] intValue]; if (mcp1Length > mallocLength1) { mallocLength1 = mcp1Length; free(seqBuffer1); seqBuffer1 = malloc(mallocLength1); } [cacheFile1 symbols: seqBuffer1 atPosition: mcp1Offset[0] ofLength: mcp1Length forSequenceNumber: mcp1SeqIndex]; } // move position forward if (getNewPos) { fgetpos(mcp2, &mcp2Pos); } // next sequence if (read2Flag) { fread(&mcp2Length, sizeof(int), 1, mcp2); fread(&mcp2NumFiles, sizeof(int), 1, mcp2); for (i = 0; i < mcp2NumFiles; ++i) { fread(&(mcp2Offset[i]), sizeof(int), 1, mcp2); fread(&(mcp2File[i]), sizeof(int), 1, mcp2); } mcp2Index = [[sequenceToMeta2 objectAtIndex: mcp2File[0]] intValue]; cacheFile2 = [cachedFiles2 objectAtIndex: mcp2Index]; mcp2Seqs = [[seqFiles2 objectAtIndex: mcp2Index] objectForKey: @"sequences"]; seq2Start = [[[mcp2Seqs objectAtIndex: 0] objectForKey: @"number"] intValue]; mcp2SeqIndex = mcp2File[0] - seq2Start; seq2Len = [[[mcp2Seqs objectAtIndex: mcp2SeqIndex] objectForKey: @"length"] intValue]; if (mcp2Length > mallocLength2) { mallocLength2 = mcp2Length; free(seqBuffer2); seqBuffer2 = malloc(mallocLength2); } [cacheFile2 symbols: seqBuffer2 atPosition: mcp2Offset[0] ofLength: mcp2Length forSequenceNumber: mcp2SeqIndex]; } } } fclose(mcp1); fclose(mcp2); fclose(mcp3); free(seqBuffer1); free(seqBuffer2); return YES; } - (BOOL)unionToFile:(NSString *)aPath withMCP:(BCMCP *)anMCP { int i, j; int mallocLength1 = 10000, mallocLength2 = 10000; char *seqBuffer1 = (char *)malloc(mallocLength1); char *seqBuffer2 = (char *)malloc(mallocLength2); FILE *mcp1 = [self getFILE]; NSArray *seqFiles1 = [metaDict objectForKey: @"sequence files"]; int lb1 = [[metaDict objectForKey: @"lower bound"] intValue]; int mcp1Cnt = [[[[[seqFiles1 lastObject] objectForKey: @"sequences"] lastObject] objectForKey: @"number"] intValue] + 1; FILE *mcp2 = [anMCP getFILE]; NSDictionary *metaDict2 = [anMCP metaDictionary]; int lb2 = [[metaDict2 objectForKey: @"lower bound"] intValue]; NSArray *sequenceToMeta2 = [anMCP sequenceToMeta]; NSArray *cachedFiles2 = [anMCP cachedFiles]; NSArray *seqFiles2 = [metaDict2 objectForKey: @"sequence files"]; int mcp2Cnt = [[[[[seqFiles2 lastObject] objectForKey: @"sequences"] lastObject] objectForKey: @"number"] intValue] + 1; // have to take larger for lower bound int lowerBound; if (lb1 > lb2) lowerBound = lb1; else lowerBound = lb2; // Eliminate duplicate sequence files NSFileManager *fileManager = [NSFileManager defaultManager]; NSMutableArray *seqFiles3 = [NSMutableArray arrayWithArray: seqFiles1]; int mapSeqs[mcp2Cnt]; int mapCnt = 0; int totCnt = mcp1Cnt; for (i = 0; i < [seqFiles2 count]; ++i) { NSDictionary *d1 = [seqFiles2 objectAtIndex: i]; NSString *s1 = [d1 objectForKey: @"sequences file"]; NSDictionary *fileAttr = [fileManager fileAttributesAtPath: s1 traverseLink: YES]; NSNumber *fn1 = [fileAttr objectForKey: NSFileSystemFileNumber]; BOOL found = NO; int foundMap = 0; for (j = 0; j < [seqFiles1 count]; ++j) { NSDictionary *d2 = [seqFiles3 objectAtIndex: j]; NSString *s2 = [d2 objectForKey: @"sequences file"]; fileAttr = [fileManager fileAttributesAtPath: s2 traverseLink: YES]; NSNumber *fn2 = [fileAttr objectForKey: NSFileSystemFileNumber]; if ([fn1 isEqualToNumber: fn2]) { found = YES; foundMap = j; //printf("%d %s\n", j, [[d2 description] UTF8String]); break; } } if (!found) { NSMutableDictionary *newDict = [NSMutableDictionary dictionaryWithDictionary: d1]; NSArray *oldArray = [newDict objectForKey: @"sequences"]; NSMutableArray *newArray = [NSMutableArray array]; for (j = 0; j < [oldArray count]; ++j) { mapSeqs[mapCnt] = totCnt; NSMutableDictionary *seqDict = [NSMutableDictionary dictionaryWithDictionary: [oldArray objectAtIndex: j]]; [seqDict setObject: [NSNumber numberWithInt: totCnt] forKey: @"number"]; [newArray addObject: seqDict]; //printf("not found: %d %d %d\n", j, mapCnt, totCnt); ++mapCnt; ++totCnt; } [newDict setObject: newArray forKey: @"sequences"]; [seqFiles3 addObject: newDict]; } else { NSDictionary *d2 = [seqFiles3 objectAtIndex: foundMap]; NSArray *oldArray = [d2 objectForKey: @"sequences"]; for (j = 0; j < [oldArray count]; ++j) { mapSeqs[mapCnt] = foundMap + j; //printf("found: %d %d %d\n", j, mapCnt, totCnt); ++mapCnt; } } } printf("%d total unique sequence files.\n", totCnt); #if 0 for (i = 0; i < totCnt; ++i) { NSDictionary *d = [seqFiles3 objectAtIndex: i]; printf("%s\n\n", [[d description] UTF8String]); } for (i = 0; i < mcp1Cnt; ++i) { NSDictionary *d = [seqFiles3 objectAtIndex: i]; printf("%s\n\n", [[d description] UTF8String]); } for (i = 0; i < mcp2Cnt; ++i) { NSDictionary *d = [seqFiles3 objectAtIndex: mapSeqs[i]]; printf("%d %s\n\n", mapSeqs[i], [[d description] UTF8String]); } #endif // open output mcp file NSString *aString = [aPath stringByAppendingPathExtension: @"mcp"]; FILE *mcp3 = fopen([aString UTF8String], "w"); if (!mcp3) { NSLog(@"Could not open file: %@\n", aString); fclose(mcp1); fclose(mcp2); free(seqBuffer1); free(seqBuffer2); return NO; } // meta mcp file NSString *metaFile = [aPath stringByAppendingPathExtension: @"meta_mcp"]; NSMutableDictionary *metaDict3 = [NSMutableDictionary dictionary]; [metaDict3 setObject: aString forKey: @"mcp file"]; [metaDict3 setObject: seqFiles3 forKey: @"sequence files"]; [metaDict3 setObject: [NSNumber numberWithInt: lowerBound] forKey: @"lower bound"]; [metaDict3 writeToFile: metaFile atomically: YES]; // union the mcp arrays by merging the sorted lists int mcp1Length, mcp1NumFiles; int mcp1File[totCnt], mcp1Offset[totCnt]; fread(&mcp1Length, sizeof(int), 1, mcp1); fread(&mcp1NumFiles, sizeof(int), 1, mcp1); for (i = 0; i < mcp1NumFiles; ++i) { fread(&(mcp1Offset[i]), sizeof(int), 1, mcp1); fread(&(mcp1File[i]), sizeof(int), 1, mcp1); } int mcp1Index, seq1Start, mcp1SeqIndex, seq1Len = 0; NSArray *mcp1Seqs; BCCachedSequenceFile *cacheFile1; if (!feof(mcp1)) { mcp1Index = [[sequenceToMeta objectAtIndex: mcp1File[0]] intValue]; cacheFile1 = [cachedFiles objectAtIndex: mcp1Index]; mcp1Seqs = [[seqFiles1 objectAtIndex: mcp1Index] objectForKey: @"sequences"]; seq1Start = [[[mcp1Seqs objectAtIndex: 0] objectForKey: @"number"] intValue]; mcp1SeqIndex = mcp1File[0] - seq1Start; seq1Len = [[[mcp1Seqs objectAtIndex: mcp1SeqIndex] objectForKey: @"length"] intValue]; if (mcp1Length > mallocLength1) { mallocLength1 = mcp1Length; free(seqBuffer1); seqBuffer1 = malloc(mallocLength1); } [cacheFile1 symbols: seqBuffer1 atPosition: mcp1Offset[0] ofLength: mcp1Length forSequenceNumber: mcp1SeqIndex]; } int mcp2Length, mcp2NumFiles; int mcp2File[totCnt], mcp2Offset[totCnt]; fread(&mcp2Length, sizeof(int), 1, mcp2); fread(&mcp2NumFiles, sizeof(int), 1, mcp2); for (i = 0; i < mcp2NumFiles; ++i) { fread(&(mcp2Offset[i]), sizeof(int), 1, mcp2); fread(&(mcp2File[i]), sizeof(int), 1, mcp2); } int mcp2Index, seq2Start, mcp2SeqIndex, seq2Len = 0; NSArray *mcp2Seqs; BCCachedSequenceFile *cacheFile2; if (!feof(mcp2)) { mcp2Index = [[sequenceToMeta2 objectAtIndex: mcp2File[0]] intValue]; cacheFile2 = [cachedFiles2 objectAtIndex: mcp2Index]; mcp2Seqs = [[seqFiles2 objectAtIndex: mcp2Index] objectForKey: @"sequences"]; seq2Start = [[[mcp2Seqs objectAtIndex: 0] objectForKey: @"number"] intValue]; mcp2SeqIndex = mcp2File[0] - seq2Start; seq2Len = [[[mcp2Seqs objectAtIndex: mcp2SeqIndex] objectForKey: @"length"] intValue]; if (mcp2Length > mallocLength2) { mallocLength2 = mcp2Length; free(seqBuffer2); seqBuffer2 = malloc(mallocLength2); } [cacheFile2 symbols: seqBuffer2 atPosition: mcp2Offset[0] ofLength: mcp2Length forSequenceNumber: mcp2SeqIndex]; } while (!feof(mcp1)) { if (feof(mcp2)) break; //printf("offset: %d file: %s\n", mcp1Offset, // [[mcp1Seqs objectAtIndex: mcp1File] UTF8String]); //printf("offset: %d file: %s\n", mcp2Offset, // [[mcp2Seqs objectAtIndex: mcp2File] UTF8String]); BOOL done = NO; int offsetToWrite = 0; #if 0 fseek(seq1[mcp1File[0]], mcp1Offset[0], SEEK_SET); fseek(seq2[mcp2File[0]], mcp2Offset[0], SEEK_SET); #endif // files and offsets may be identical // if same sequence matches in multiple places // of other organism if ((mcp1Offset[0] == mcp2Offset[0]) && (mcp1File[0] == mapSeqs[mcp2File[0]])) { done = YES; offsetToWrite = 3; } int nextMax = 0; int mcp1Len = 0, mcp2Len = 0; while (!done) { // check end-of-sequence conditions BOOL eos1 = NO, eos2 = NO; if (mcp1Offset[0] < seq1Len) { // forward strand if ((mcp1Offset[0] + mcp1Len) >= seq1Len) { eos1 = YES; } } else { // reverse strand if ((mcp1Offset[0] + mcp1Len) >= (2*seq1Len)) { eos1 = YES; } } if (mcp2Offset[0] < seq2Len) { // forward strand if ((mcp2Offset[0] + mcp2Len) >= seq2Len) { eos2 = YES; } } else { // reverse strand if ((mcp2Offset[0] + mcp2Len) >= (2*seq2Len)) { eos2 = YES; } } if (eos1 && eos2) { // both at end-of-sequence, so strings must be identical done = YES; offsetToWrite = 3; continue; } else { if (eos1) { // end of first sequence, it is lower done = YES; offsetToWrite = 1; continue; } if (eos2) { // end of second sequence, it is lower done = YES; offsetToWrite = 2; continue; } } // cannot go past the length of the mcp if (nextMax == mcp1Length) { if (nextMax == mcp2Length) { // both at length, so strings must be identical done = YES; offsetToWrite = 3; continue; } // end of first sequence, it is lower done = YES; offsetToWrite = 1; continue; } if (nextMax == mcp2Length) { // end of second sequence, it is lower done = YES; offsetToWrite = 2; continue; } char c1, c2; //c1 = [cacheFile1 symbolAtPosition: (mcp1Offset[0] + mcp1Len) forSequenceNumber: mcp1SeqIndex]; c1 = seqBuffer1[mcp1Len]; ++mcp1Len; //c2 = [cacheFile2 symbolAtPosition: (mcp2Offset[0] + mcp2Len) forSequenceNumber: mcp2SeqIndex]; c2 = seqBuffer2[mcp2Len]; ++mcp2Len; //printf("c1: %c c2: %c\n", c1, c2); // handle case c1 = toupper(c1); c2 = toupper(c2); if (c1 == c2) { ++nextMax; continue; } if (c1 > c2) { done = YES; offsetToWrite = 2; } else { done = YES; offsetToWrite = 1; } } if (offsetToWrite == 1) { // sequence is lower, so write it out fwrite(&mcp1Length, sizeof(int), 1, mcp3); fwrite(&mcp1NumFiles, sizeof(int), 1, mcp3); for (i = 0; i < mcp1NumFiles; ++i) { fwrite(&mcp1Offset[i], sizeof(int), 1, mcp3); fwrite(&mcp1File[i], sizeof(int), 1, mcp3); } // next sequence fread(&mcp1Length, sizeof(int), 1, mcp1); fread(&mcp1NumFiles, sizeof(int), 1, mcp1); for (i = 0; i < mcp1NumFiles; ++i) { fread(&(mcp1Offset[i]), sizeof(int), 1, mcp1); fread(&(mcp1File[i]), sizeof(int), 1, mcp1); } mcp1Index = [[sequenceToMeta objectAtIndex: mcp1File[0]] intValue]; cacheFile1 = [cachedFiles objectAtIndex: mcp1Index]; mcp1Seqs = [[seqFiles1 objectAtIndex: mcp1Index] objectForKey: @"sequences"]; seq1Start = [[[mcp1Seqs objectAtIndex: 0] objectForKey: @"number"] intValue]; mcp1SeqIndex = mcp1File[0] - seq1Start; seq1Len = [[[mcp1Seqs objectAtIndex: mcp1SeqIndex] objectForKey: @"length"] intValue]; if (mcp1Length > mallocLength1) { mallocLength1 = mcp1Length; free(seqBuffer1); seqBuffer1 = malloc(mallocLength1); } [cacheFile1 symbols: seqBuffer1 atPosition: mcp1Offset[0] ofLength: mcp1Length forSequenceNumber: mcp1SeqIndex]; } else if (offsetToWrite == 2) { // sequence is lower, so write it out fwrite(&mcp2Length, sizeof(int), 1, mcp3); fwrite(&mcp2NumFiles, sizeof(int), 1, mcp3); for (i = 0; i < mcp2NumFiles; ++i) { int fileNum = mapSeqs[mcp2File[i]]; fwrite(&mcp2Offset[i], sizeof(int), 1, mcp3); fwrite(&fileNum, sizeof(int), 1, mcp3); } // next sequence fread(&mcp2Length, sizeof(int), 1, mcp2); fread(&mcp2NumFiles, sizeof(int), 1, mcp2); for (i = 0; i < mcp2NumFiles; ++i) { fread(&(mcp2Offset[i]), sizeof(int), 1, mcp2); fread(&(mcp2File[i]), sizeof(int), 1, mcp2); } mcp2Index = [[sequenceToMeta2 objectAtIndex: mcp2File[0]] intValue]; cacheFile2 = [cachedFiles2 objectAtIndex: mcp2Index]; mcp2Seqs = [[seqFiles2 objectAtIndex: mcp2Index] objectForKey: @"sequences"]; seq2Start = [[[mcp2Seqs objectAtIndex: 0] objectForKey: @"number"] intValue]; mcp2SeqIndex = mcp2File[0] - seq2Start; seq2Len = [[[mcp2Seqs objectAtIndex: mcp2SeqIndex] objectForKey: @"length"] intValue]; if (mcp2Length > mallocLength2) { mallocLength2 = mcp2Length; free(seqBuffer2); seqBuffer2 = malloc(mallocLength2); } [cacheFile2 symbols: seqBuffer2 atPosition: mcp2Offset[0] ofLength: mcp2Length forSequenceNumber: mcp2SeqIndex]; } else if (offsetToWrite == 3) { // both sequences identical //printf("Identical string: (%d, %s):(%d, %s) and (%d, %s):(%d, %s)\n", // mcp1Offset1, [[mcp1Seqs objectAtIndex: mcp1File1] UTF8String], // mcp1Offset2, [[mcp1Seqs objectAtIndex: mcp1File2] UTF8String], // mcp2Offset1, [[mcp2Seqs objectAtIndex: mcp2File1] UTF8String], // mcp2Offset2, [[mcp2Seqs objectAtIndex: mcp2File2] UTF8String]); // write out both fwrite(&mcp1Length, sizeof(int), 1, mcp3); fwrite(&mcp1NumFiles, sizeof(int), 1, mcp3); for (i = 0; i < mcp1NumFiles; ++i) { fwrite(&mcp1Offset[i], sizeof(int), 1, mcp3); fwrite(&mcp1File[i], sizeof(int), 1, mcp3); } fwrite(&mcp2Length, sizeof(int), 1, mcp3); fwrite(&mcp2NumFiles, sizeof(int), 1, mcp3); for (i = 0; i < mcp2NumFiles; ++i) { int fileNum = mapSeqs[mcp2File[i]]; fwrite(&mcp2Offset[i], sizeof(int), 1, mcp3); fwrite(&fileNum, sizeof(int), 1, mcp3); } // next sequence fread(&mcp1Length, sizeof(int), 1, mcp1); fread(&mcp1NumFiles, sizeof(int), 1, mcp1); for (i = 0; i < mcp1NumFiles; ++i) { fread(&(mcp1Offset[i]), sizeof(int), 1, mcp1); fread(&(mcp1File[i]), sizeof(int), 1, mcp1); } mcp1Index = [[sequenceToMeta objectAtIndex: mcp1File[0]] intValue]; cacheFile1 = [cachedFiles objectAtIndex: mcp1Index]; mcp1Seqs = [[seqFiles1 objectAtIndex: mcp1Index] objectForKey: @"sequences"]; seq1Start = [[[mcp1Seqs objectAtIndex: 0] objectForKey: @"number"] intValue]; mcp1SeqIndex = mcp1File[0] - seq1Start; seq1Len = [[[mcp1Seqs objectAtIndex: mcp1SeqIndex] objectForKey: @"length"] intValue]; if (mcp1Length > mallocLength1) { mallocLength1 = mcp1Length; free(seqBuffer1); seqBuffer1 = malloc(mallocLength1); } [cacheFile1 symbols: seqBuffer1 atPosition: mcp1Offset[0] ofLength: mcp1Length forSequenceNumber: mcp1SeqIndex]; fread(&mcp2Length, sizeof(int), 1, mcp2); fread(&mcp2NumFiles, sizeof(int), 1, mcp2); for (i = 0; i < mcp2NumFiles; ++i) { fread(&(mcp2Offset[i]), sizeof(int), 1, mcp2); fread(&(mcp2File[i]), sizeof(int), 1, mcp2); } mcp2Index = [[sequenceToMeta2 objectAtIndex: mcp2File[0]] intValue]; cacheFile2 = [cachedFiles2 objectAtIndex: mcp2Index]; mcp2Seqs = [[seqFiles2 objectAtIndex: mcp2Index] objectForKey: @"sequences"]; seq2Start = [[[mcp2Seqs objectAtIndex: 0] objectForKey: @"number"] intValue]; mcp2SeqIndex = mcp2File[0] - seq2Start; seq2Len = [[[mcp2Seqs objectAtIndex: mcp2SeqIndex] objectForKey: @"length"] intValue]; if (mcp2Length > mallocLength2) { mallocLength2 = mcp2Length; free(seqBuffer2); seqBuffer2 = malloc(mallocLength2); } [cacheFile2 symbols: seqBuffer2 atPosition: mcp2Offset[0] ofLength: mcp2Length forSequenceNumber: mcp2SeqIndex]; } else { printf("ERROR: offsetToWrite is %d.\n", offsetToWrite); return NO; } } if (feof(mcp1)) { // write out remaining sequences while (!feof(mcp2)) { fwrite(&mcp2Length, sizeof(int), 1, mcp3); fwrite(&mcp2NumFiles, sizeof(int), 1, mcp3); for (i = 0; i < mcp2NumFiles; ++i) { int fileNum = mapSeqs[mcp2File[i]]; fwrite(&mcp2Offset[i], sizeof(int), 1, mcp3); fwrite(&fileNum, sizeof(int), 1, mcp3); } fread(&mcp2Length, sizeof(int), 1, mcp2); fread(&mcp2NumFiles, sizeof(int), 1, mcp2); for (i = 0; i < mcp2NumFiles; ++i) { fread(&(mcp2Offset[i]), sizeof(int), 1, mcp2); fread(&(mcp2File[i]), sizeof(int), 1, mcp2); } } } else if (feof(mcp2)) { // write out remaining sequences while (!feof(mcp1)) { fwrite(&mcp1Length, sizeof(int), 1, mcp3); fwrite(&mcp1NumFiles, sizeof(int), 1, mcp3); for (i = 0; i < mcp1NumFiles; ++i) { fwrite(&mcp1Offset[i], sizeof(int), 1, mcp3); fwrite(&mcp1File[i], sizeof(int), 1, mcp3); } fread(&mcp1Length, sizeof(int), 1, mcp1); fread(&mcp1NumFiles, sizeof(int), 1, mcp1); for (i = 0; i < mcp1NumFiles; ++i) { fread(&(mcp1Offset[i]), sizeof(int), 1, mcp1); fread(&(mcp1File[i]), sizeof(int), 1, mcp1); } } } else { printf("ERROR: not at EOF for either file.\n"); return NO; } fclose(mcp1); fclose(mcp2); fclose(mcp3); free(seqBuffer1); free(seqBuffer2); return YES; } - (BOOL)trimToFile:(NSString *)aPath { int i; NSMutableArray *rangeList = [NSMutableArray new]; FILE *mcp = [self getFILE]; NSArray *seqFiles = [metaDict objectForKey: @"sequence files"]; int mcpCnt = [[[[[seqFiles lastObject] objectForKey: @"sequences"] lastObject] objectForKey: @"number"] intValue] + 1; while (!feof(mcp)) { int mcpLength, mcpNumFiles; int mcpFile[mcpCnt], mcpOffset[mcpCnt]; fread(&mcpLength, sizeof(int), 1, mcp); fread(&mcpNumFiles, sizeof(int), 1, mcp); for (i = 0; i < mcpNumFiles; ++i) { fread(&(mcpOffset[i]), sizeof(int), 1, mcp); fread(&(mcpFile[i]), sizeof(int), 1, mcp); } MCPNode *aNode = [[MCPNode alloc] initWithMCPLength: mcpCnt]; aNode->numFiles = mcpNumFiles; for (i = 0; i < mcpNumFiles; ++i) { aNode->file[i] = mcpFile[i]; aNode->sequence[i].location = mcpOffset[i]; aNode->sequence[i].length = mcpLength; } insert_range(rangeList, aNode, metaDict); } // open output mcp file NSString *aString = [aPath stringByAppendingPathExtension: @"mcp"]; FILE *mcp3 = fopen([aString UTF8String], "w"); if (!mcp3) { NSLog(@"Could not open file: %@\n", aString); fclose(mcp); return NO; } // meta mcp file NSString *metaFile = [aPath stringByAppendingPathExtension: @"meta_mcp"]; NSMutableDictionary *metaDict3 = [NSMutableDictionary dictionaryWithDictionary: metaDict]; [metaDict3 setObject: aString forKey: @"mcp file"]; [metaDict3 writeToFile: metaFile atomically: YES]; // sort by length NSArray *sortedArray = [rangeList sortedArrayUsingSelector:@selector(lengthCompare:)]; // write out trimmed mcps //printf("%d trimmed sequences\n", [sortedArray count]); int j; for (i = [sortedArray count] - 1; i >= 0; --i) { MCPNode *n = [sortedArray objectAtIndex: i]; //printf("range (%d, %d)\n", n->sequence[0].location, n->sequence[0].length); fwrite(&(n->sequence[0].length), sizeof(int), 1, mcp3); fwrite(&(n->numFiles), sizeof(int), 1, mcp3); for (j = 0; j < n->numFiles; ++j) { fwrite(&(n->sequence[j].location), sizeof(int), 1, mcp3); fwrite(&(n->file[j]), sizeof(int), 1, mcp3); } } fclose(mcp3); fclose(mcp); return YES; } - (void)buildReverseComplementArray { int cnt = [sequenceArray count]; int i; if (reverseComplementArray) [reverseComplementArray release]; reverseComplementArray = [[BCSequenceArray alloc] init]; for (i = 0; i < cnt; ++i) { BCSequence *aSeq = [sequenceArray sequenceAtIndex: i]; int j; char *seqData = (char *)[[aSeq sequenceData] bytes]; int seqLen = [aSeq length]; char *revData = (char *)malloc(seqLen * sizeof(char)); for (j = 0; j < seqLen; ++j) { char c = seqData[j]; switch (c) { case 'a': c = 't'; break; case 't': c = 'a'; break; case 'c': c = 'g'; break; case 'g': c = 'c'; break; case 'A': c = 'T'; break; case 'T': c = 'A'; break; case 'C': c = 'G'; break; case 'G': c = 'C'; break; default: break; } revData[seqLen - j - 1] = c; } NSData *finalData = [NSData dataWithBytes: revData length: seqLen]; BCSequence *newSequence = [[BCSequence alloc] initWithData: finalData symbolSet: [BCSymbolSet dnaSymbolSet]]; [reverseComplementArray addSequence: newSequence]; } } - initWithContentsOfFile:(NSString *)aPath inMemory:(BOOL)aFlag { [super init]; inMemory = aFlag; cachedFiles = nil; sequenceArray = nil; // read meta file NSString *metaFile = [aPath stringByAppendingPathExtension: @"meta_mcp"]; metaDict = [[NSMutableDictionary alloc] initWithContentsOfFile: metaFile]; if (!metaDict) return nil; sequenceToMeta = [NSMutableArray new]; int i, j; NSArray *seqFiles = [metaDict objectForKey: @"sequence files"]; if (inMemory) { // load sequences into memory sequenceArray = [BCSequenceArray new]; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; for (i = 0; i < [seqFiles count]; ++i) { NSDictionary *d = [seqFiles objectAtIndex: i]; NSString *s = [d objectForKey: @"sequences file"]; BCSequenceArray *seqArray = [sequenceReader readFileUsingPath: s]; for (j = 0; j < [seqArray count]; ++j) { [sequenceArray addSequence: [seqArray sequenceAtIndex: j]]; [sequenceToMeta addObject: [NSNumber numberWithInt: i]]; } } [self buildReverseComplementArray]; } else { // cache the sequence files cachedFiles = [NSMutableArray new]; for (i = 0; i < [seqFiles count]; ++i) { NSDictionary *d = [seqFiles objectAtIndex: i]; NSString *s = [d objectForKey: @"sequences file"]; BCCachedSequenceFile *cachedFile = [BCCachedSequenceFile readCachedFileUsingPath: s]; [cachedFiles addObject: cachedFile]; for (j = 0; j < [cachedFile numberOfSequences]; ++j) { [sequenceToMeta addObject: [NSNumber numberWithInt: i]]; } } } return self; } - (BOOL)writeToFile:(NSString *)aPath { return NO; } - (FILE *)getFILE { if (!metaDict) return NULL; NSString *s = [metaDict objectForKey: @"mcp file"]; if (!s) return NULL; FILE *mcp = fopen([s UTF8String], "r"); return mcp; } - (BOOL)isInMemory { return inMemory; } - (BCSequenceArray *)sequenceArray { return sequenceArray; } - (BCSequenceArray *)reverseComplementArray { return reverseComplementArray; } - (NSDictionary *)metaDictionary { return metaDict; } - (NSArray *)sequenceToMeta { return sequenceToMeta; } - (NSArray *)cachedFiles { return cachedFiles; } // // Output methods // #define FASTA_FORMAT 1 #define SUMMARY_FORMAT 2 #define TABLE_FORMAT 3 #define RAW_FORMAT 4 - (void)printHeaderFormat:(int)aFormat number:(int)aNum length:(int)aLen { switch (aFormat) { case FASTA_FORMAT: printf(">mcp%d length: %d files:", aNum, aLen); break; case SUMMARY_FORMAT: printf("length: %d files:", aLen); break; case TABLE_FORMAT: printf("%d", aLen); } } - (void)printEntryFormat:(int)aFormat file:(NSString *)fileName seq:(NSString *)seqID strand:(NSString *)theStrand position:(int)aPos { switch (aFormat) { case FASTA_FORMAT: case SUMMARY_FORMAT: printf(" %s(%s,%s:%d)", [fileName UTF8String], [seqID UTF8String], [theStrand UTF8String], aPos); break; case TABLE_FORMAT: printf("\t%s\t%s\t%s\t%d", [fileName UTF8String], [seqID UTF8String], [theStrand UTF8String], aPos); } } - (void)outputFormat:(int)outputFormat withMinimumLength:(int)minLength { FILE *mcp = [self getFILE]; if (!mcp) return; NSArray *seqFiles = [metaDict objectForKey: @"sequence files"]; int mcpCnt = [sequenceToMeta count]; // max MCP int maxLength = 0, maxNumFiles = 0, maxNumOfMCP = 0; int maxFile[mcpCnt], maxOffset[mcpCnt]; int numOfMCP = 1; int mcpLength, mcpNumFiles; int mcpFile[mcpCnt], mcpOffset[mcpCnt]; fread(&mcpLength, sizeof(int), 1, mcp); fread(&mcpNumFiles, sizeof(int), 1, mcp); int i; for (i = 0; i < mcpNumFiles; ++i) { fread(&(mcpOffset[i]), sizeof(int), 1, mcp); fread(&(mcpFile[i]), sizeof(int), 1, mcp); } NSAutoreleasePool *pool = [NSAutoreleasePool new]; while (!feof(mcp)) { // free up temporary data for large MCP files if ((numOfMCP % 100000) == 0) { [pool release]; pool = [NSAutoreleasePool new]; } // not just the maximum if ((minLength != 0) && (mcpLength >= minLength)) { // output MCP meta data [self printHeaderFormat: outputFormat number: numOfMCP length: mcpLength]; for (i = 0; i < mcpNumFiles; ++i) { // get sequence info NSString *seqFile, *seqID, *theStrand; int aPos, seqLen; if (inMemory) { // sequences in memory NSNumber *n = [sequenceToMeta objectAtIndex: mcpFile[i]]; NSDictionary *aDict = [seqFiles objectAtIndex: [n intValue]]; seqFile = [[aDict objectForKey: @"sequences file"] lastPathComponent]; BCSequence *aSeq = [sequenceArray sequenceAtIndex: mcpFile[i]]; seqLen = [aSeq length]; seqID = [[aSeq annotationForKey: @">"] stringValue]; } else { // cached sequences on disk int mcpIndex = [[sequenceToMeta objectAtIndex: mcpFile[i]] intValue]; seqFile = [[[seqFiles objectAtIndex: mcpIndex] objectForKey: @"sequences file"] lastPathComponent]; NSArray *mcpSeqs = [[seqFiles objectAtIndex: mcpIndex] objectForKey: @"sequences"]; int seqStart = [[[mcpSeqs objectAtIndex: 0] objectForKey: @"number"] intValue]; int mcpSeqIndex = mcpFile[i] - seqStart; seqLen = [[[mcpSeqs objectAtIndex: mcpSeqIndex] objectForKey: @"length"] intValue]; seqID = [[mcpSeqs objectAtIndex: mcpSeqIndex] objectForKey: @"id"]; } if (mcpOffset[i] < seqLen) { theStrand = @"F"; aPos = mcpOffset[i]; } else { theStrand = @"R"; aPos = 2*seqLen - mcpOffset[i] - mcpLength; } NSRange aRange = [seqID rangeOfString: @" "]; if (aRange.location != NSNotFound) { aRange.length = aRange.location; aRange.location = 0; seqID = [seqID substringWithRange: aRange]; } [self printEntryFormat: outputFormat file: seqFile seq: seqID strand: theStrand position: aPos]; } if (outputFormat == FASTA_FORMAT) printf("\n"); if (outputFormat == SUMMARY_FORMAT) printf("\nsequence:\n"); if (outputFormat == TABLE_FORMAT) printf("\n"); // output sequence data if ((outputFormat == FASTA_FORMAT) || (outputFormat == SUMMARY_FORMAT)) { char *seqData = NULL; BCCachedSequenceFile *cacheFile = nil; int aPos, mcpSeqIndex = 0; if (inMemory) { BCSequence *aSeq = [sequenceArray sequenceAtIndex: mcpFile[0]]; int seqLen = [aSeq length]; if (mcpOffset[0] < seqLen) { seqData = (char *)[[aSeq sequenceData] bytes]; aPos = mcpOffset[0]; } else { aSeq = [reverseComplementArray sequenceAtIndex: mcpFile[0]]; seqData = (char *)[[aSeq sequenceData] bytes]; aPos = 2*seqLen - mcpOffset[0] - mcpLength; } } else { int mcpIndex = [[sequenceToMeta objectAtIndex: mcpFile[0]] intValue]; cacheFile = [cachedFiles objectAtIndex: mcpIndex]; NSArray *mcpSeqs = [[seqFiles objectAtIndex: mcpIndex] objectForKey: @"sequences"]; int seqStart = [[[mcpSeqs objectAtIndex: 0] objectForKey: @"number"] intValue]; mcpSeqIndex = mcpFile[0] - seqStart; aPos = mcpOffset[0]; } int j; int lineLen = 0; for (j = 0; j < mcpLength; ++j) { if (inMemory) printf("%c", seqData[aPos + j]); else printf("%c", [cacheFile symbolAtPosition: (aPos + j) forSequenceNumber: mcpSeqIndex]); ++lineLen; if ((outputFormat == FASTA_FORMAT) && (lineLen == 50) && (mcpLength > 70)) { printf("\n"); lineLen = 0; } } if (outputFormat == FASTA_FORMAT) printf("\n"); else printf("\n\n"); } } // new maximum? if (mcpLength > maxLength) { maxLength = mcpLength; maxNumFiles = mcpNumFiles; maxNumOfMCP = numOfMCP; for (i = 0; i < mcpNumFiles; ++i) { maxOffset[i] = mcpOffset[i]; maxFile[i] = mcpFile[i]; } } // next sequence ++numOfMCP; fread(&mcpLength, sizeof(int), 1, mcp); fread(&mcpNumFiles, sizeof(int), 1, mcp); for (i = 0; i < mcpNumFiles; ++i) { fread(&(mcpOffset[i]), sizeof(int), 1, mcp); fread(&(mcpFile[i]), sizeof(int), 1, mcp); } } // only print max if no min length specified if (maxLength == 0) printf("Empty mcp file.\n"); else if (minLength == 0) { [self printHeaderFormat: outputFormat number: maxNumOfMCP length: maxLength]; // output MCP meta data for (i = 0; i < maxNumFiles; ++i) { // get sequence info NSString *seqFile, *seqID, *theStrand; int aPos, seqLen; if (inMemory) { // sequences in memory NSNumber *n = [sequenceToMeta objectAtIndex: maxFile[i]]; NSDictionary *aDict = [seqFiles objectAtIndex: [n intValue]]; seqFile = [[aDict objectForKey: @"sequences file"] lastPathComponent]; BCSequence *aSeq = [sequenceArray sequenceAtIndex: maxFile[i]]; seqLen = [aSeq length]; seqID = [[aSeq annotationForKey: @">"] stringValue]; } else { // cached sequences on disk int mcpIndex = [[sequenceToMeta objectAtIndex: maxFile[i]] intValue]; seqFile = [[[seqFiles objectAtIndex: mcpIndex] objectForKey: @"sequences file"] lastPathComponent]; NSArray *mcpSeqs = [[seqFiles objectAtIndex: mcpIndex] objectForKey: @"sequences"]; int seqStart = [[[mcpSeqs objectAtIndex: 0] objectForKey: @"number"] intValue]; int mcpSeqIndex = maxFile[i] - seqStart; seqLen = [[[mcpSeqs objectAtIndex: mcpSeqIndex] objectForKey: @"length"] intValue]; seqID = [[mcpSeqs objectAtIndex: mcpSeqIndex] objectForKey: @"id"]; } if (maxOffset[i] < seqLen) { theStrand = @"F"; aPos = maxOffset[i]; } else { theStrand = @"R"; aPos = 2*seqLen - maxOffset[i] - maxLength; } NSRange aRange = [seqID rangeOfString: @" "]; if (aRange.location != NSNotFound) { aRange.length = aRange.location; aRange.location = 0; seqID = [seqID substringWithRange: aRange]; } [self printEntryFormat: outputFormat file: seqFile seq: seqID strand: theStrand position: aPos]; } if (outputFormat == FASTA_FORMAT) printf("\n"); if (outputFormat == SUMMARY_FORMAT) printf("\nsequence:\n"); if (outputFormat == TABLE_FORMAT) printf("\n"); // output sequence data if ((outputFormat == FASTA_FORMAT) || (outputFormat == SUMMARY_FORMAT)) { char *seqData = NULL; BCCachedSequenceFile *cacheFile = nil; int aPos, mcpSeqIndex = 0; if (inMemory) { BCSequence *aSeq = [sequenceArray sequenceAtIndex: maxFile[0]]; int seqLen = [aSeq length]; if (maxOffset[0] < seqLen) { seqData = (char *)[[aSeq sequenceData] bytes]; aPos = maxOffset[0]; } else { aSeq = [reverseComplementArray sequenceAtIndex: maxFile[0]]; seqData = (char *)[[aSeq sequenceData] bytes]; aPos = 2*seqLen - maxOffset[0] - maxLength; } } else { int mcpIndex = [[sequenceToMeta objectAtIndex: maxFile[0]] intValue]; cacheFile = [cachedFiles objectAtIndex: mcpIndex]; NSArray *mcpSeqs = [[seqFiles objectAtIndex: mcpIndex] objectForKey: @"sequences"]; int seqStart = [[[mcpSeqs objectAtIndex: 0] objectForKey: @"number"] intValue]; mcpSeqIndex = maxFile[0] - seqStart; aPos = maxOffset[0]; } int j; int lineLen = 0; for (j = 0; j < maxLength; ++j) { if (inMemory) printf("%c", seqData[aPos + j]); else printf("%c", [cacheFile symbolAtPosition: (aPos + j) forSequenceNumber: mcpSeqIndex]); ++lineLen; if ((outputFormat == FASTA_FORMAT) && (lineLen == 50) && (maxLength > 70)) { printf("\n"); lineLen = 0; } } printf("\n"); } } [pool release]; fclose(mcp); } - (void)summaryFormatWithMinimumLength:(int)minLength { [self outputFormat: SUMMARY_FORMAT withMinimumLength: minLength]; } - (void)fastaFormatWithMinimumLength:(int)minLength { [self outputFormat: FASTA_FORMAT withMinimumLength: minLength]; } - (void)tableFormatWithMinimumLength:(int)minLength { [self outputFormat: TABLE_FORMAT withMinimumLength: minLength]; } @end // // Helper class for MCP trim // @implementation MCPNode - initWithMCPLength: (int)num { self = [super init]; maxCnt = num; file = (int *)malloc(sizeof(int) * maxCnt); if (!file) { printf("ERROR: out of memory\n"); return nil; } sequence = (NSRange *)malloc(sizeof(NSRange) * maxCnt); if (!sequence) { printf("ERROR: out of memory\n"); return nil; } return self; } - (NSComparisonResult)lengthCompare:(MCPNode *)anObject { NSRange nr = sequence[0]; NSRange or = anObject->sequence[0]; if (nr.length > or.length) return NSOrderedDescending; if (nr.length < or.length) return NSOrderedAscending; return NSOrderedSame; } @end static void insert_range(NSMutableArray *a, MCPNode *aNode, NSDictionary *metaDict) { int i, j, k; int cnt = [a count]; //printf("insert range (%d, %d)\n", aNode->sequence[0].location, aNode->sequence[0].length); MCPNode *swapNode = nil; BOOL found = NO; MCPNode *n; for (i = 0;i < cnt; ++i) { n = [a objectAtIndex: i]; // only compare if in same files if (aNode->numFiles != n->numFiles) continue; for (j = 0; j < aNode->numFiles; ++j) { BOOL done = NO; for (k = 0; k < n->numFiles; ++k) { if (aNode->file[j] == n->file[k]) { done = YES; break; } } if (!done) { found = YES; break; } } if (found) { found = NO; continue; } // check each range for (j = 0; j < aNode->numFiles; ++j) { for (k = 0; k < n->numFiles; ++k) { if (aNode->file[j] == n->file[k]) break; } if (k == n->numFiles) { printf("ERROR: could not match files.\n"); exit(1); } MCPNode *newSwap = nil; found = NO; NSRange nr1 = aNode->sequence[j]; NSRange nr2 = n->sequence[k]; if (NSLocationInRange(nr1.location, nr2) && NSLocationInRange(nr1.location + nr1.length - 1, nr2)) { // aNode's sequence is inside n's sequence found = YES; } else if (NSLocationInRange(nr2.location, nr1) && NSLocationInRange(nr2.location + nr2.length - 1, nr1)) { // n's sequence is inside aNode's sequence found = YES; newSwap = n; } if (j == 0) swapNode = newSwap; if (!found) break; else { // all ranges have to be same comparison if (newSwap != swapNode) break; } } if (found) break; } if (!found) { [a addObject: aNode]; #if 0 printf("ADD length: %d files: %s(%d)", aNode->sequence[0].length, names[aNode->file[0]], aNode->sequence[0].location); for (i = 1; i < aNode->numFiles; ++i) printf(", %s(%d)", names[aNode->file[i]], aNode->sequence[i].location); printf("\n"); #endif } else if (swapNode) { [a removeObject: swapNode]; [a addObject: aNode]; #if 0 printf("SWAP length: %d files: %s(%d)", aNode->sequence[0].length, names[aNode->file[0]], aNode->sequence[0].location); for (i = 1; i < aNode->numFiles; ++i) printf(", %s(%d)", names[aNode->file[i]], aNode->sequence[i].location); printf("\n"); printf("WITH length: %d files: %s(%d)", swapNode->sequence[0].length, names[swapNode->file[0]], swapNode->sequence[0].location); for (i = 1; i < swapNode->numFiles; ++i) printf(", %s(%d)", names[swapNode->file[i]], swapNode->sequence[i].location); printf("\n"); } else { printf("FOUND length: %d files: %s(%d)", aNode->sequence[0].length, names[aNode->file[0]], aNode->sequence[0].location); for (i = 1; i < aNode->numFiles; ++i) printf(", %s(%d)", names[aNode->file[i]], aNode->sequence[i].location); printf("\n"); printf("INSIDE length: %d files: %s(%d)", n->sequence[0].length, names[n->file[0]], n->sequence[0].location); for (i = 1; i < n->numFiles; ++i) printf(", %s(%d)", names[n->file[i]], n->sequence[i].location); printf("\n"); #endif } } biococoa-2.2.2/BCFoundation/BCAnalysis/BCSuffixArray.h000644 000765 000024 00000011525 11370700423 023062 0ustar00scottcstaff000000 000000 // // BCSuffixArray.h // BioCocoa // // Created by Scott Christley on 7/20/07. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /* Hybrid suffix-array builder, written by Sean Quinlan and Sean Doward, distributed under the Lucent Public License Version 1.02. Copyright (C) 2003, Lucent Technologies Inc. and others. All Rights Reserved. */ /*! @header @abstract Create and manage suffix arrays for sequence data. */ #import @class BCSequence; @class BCSequenceArray; @class BCMCP; /*! @class BCSuffixArray @abstract Class that manages a suffix array for a sequence. @discussion A suffix array is a data structure containing all of the suffix * strings for a sequence in sorted order. It is useful for doing fast, simple * string searches and comparison operations. In constrast to a suffix tree, * the suffix array is easily stored on disk for large sequences like whole genomes. */ @interface BCSuffixArray : NSObject { BCSequenceArray *sequenceArray; BCSequenceArray *reverseComplementArray; NSMutableDictionary *metaDict; NSString *dirPath; NSString *tmpFile; unsigned char *memSequence; int numOfSuffixes; int *suffixArray; BOOL inMemory; long long maxMemoryUsage; int memoryState; BOOL softMask; } - (BOOL)constructFromSequence:(BCSequence *)aSequence strand:(NSString *)aStrand; - (BOOL)constructFromSequenceArray:(BCSequenceArray *)anArray strand:(NSString *)aStrand; - (BOOL)constructFromSequenceFile:(NSString *)aPath strand:(NSString *)aStrand; - initWithContentsOfFile:(NSString *)aPath forSequence:(BCSequence *)aSequence inMemory:(BOOL)aFlag; - initWithContentsOfFile:(NSString *)aPath forSequenceArray:(BCSequenceArray *)anArray inMemory:(BOOL)aFlag; - initWithContentsOfFile:(NSString *)aPath inMemory:(BOOL)aFlag; - (BOOL)writeToFile:(NSString *)aPath withMasking:(BOOL)aFlag; - (FILE *)getFILE; - (int)numberOfSequences; - (int)numOfSuffixes; - (const int *)suffixArray; - (unsigned char *)memoryForSequence:(int)aNum; - (BCSequenceArray *)sequenceArray; - (BCSequenceArray *)reverseComplementArray; - (NSDictionary *)metaDictionary; - (BOOL)softMask; - (void)setSoftMask: (BOOL)aFlag; - (void)dumpSuffixArray; - (void)dumpSuffixArrayForSequence:(int)aSeq position:(int)aPos length:(int)aLen; @end /*! @class BCSuffixArrayUnionEnumerator @abstract Provides an enumeration of the suffix strings for the union of a set of suffix arrays. @discussion Performs an on-the-fly (online) union of a set of suffix arrays with an enumeration of * the suffixes in sorted order. Each time -nextSuffixPosition is called, the enumerator moves to * the next suffix in the union; returns NO when the enumeration is at the end. If enumeration is at * the end, calling -nextSuffixPosition again will restart the enumeration back at the beginning. * Puts the current suffix position, sequence index and suffix array index into the parameters, pass * NULL for any parameters not wanted. */ @interface BCSuffixArrayUnionEnumerator : NSObject { NSArray *suffixArrays; int *suffixPositions; int *suffixSequences; FILE **arrayFiles; BOOL *eofFlags; BCSequenceArray **saSeqs; BCSequenceArray **saRevs; int currentSuffix; BCSuffixArray *currentArray; } - initWithSuffixArrays:(NSArray *)arrays; - (BOOL)nextSuffixPosition:(int *)aPos sequence:(int *)aSeq suffixArray:(int *)anArray; - (NSArray *)suffixArrays; @end #define BCSUFFIXARRAY_TERM_CHAR '#' biococoa-2.2.2/BCFoundation/BCAnalysis/BCSuffixArray.m000644 000765 000024 00000124041 11370700423 023065 0ustar00scottcstaff000000 000000 // // BCSuffixArray.m // BioCocoa // // Created by Scott Christley on 7/20/07. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /* Hybrid suffix-array builder, written by Sean Quinlan and Sean Doward, distributed under the Lucent Public License Version 1.02. Copyright (C) 2003, Lucent Technologies Inc. and others. All Rights Reserved. */ #import "BCSuffixArray.h" #import "BCFoundationDefines.h" #import "BCSequenceArray.h" #import "BCSequenceReader.h" #import "BCSymbolSet.h" #import "BCAnnotation.h" #include // suffix array routines // static int sarray(int *a, int n); static int bsarray(const unsigned char *b, int *a, int n); static long long max_physical_memory(); #define ALL_SEQS 0 #define ONE_SEQ 1 #define ONE_STRAND 2 // memory concatenation of sequences //static unsigned char* mem_concate(BCSequenceArray *anArray, NSString *strand); @implementation BCSuffixArray - init { [super init]; sequenceArray = nil; metaDict = nil; dirPath = nil; tmpFile = nil; memSequence = NULL; numOfSuffixes = 0; suffixArray = NULL; inMemory = YES; maxMemoryUsage = 0; memoryState = ALL_SEQS; softMask = NO; return self; } - (void)dealloc { if (sequenceArray) [sequenceArray release]; if (reverseComplementArray) [reverseComplementArray release]; if (metaDict) [metaDict release]; if (dirPath) [dirPath release]; if (memSequence) free(memSequence); if (suffixArray) free(suffixArray); [super dealloc]; } // // Helper methods for managing in memory sequence // - (long long)checkMemoryForSequence:(int)anIndex oneStrand:(BOOL)aFlag { // no sequence then don't need memory if (!sequenceArray) return 0; BCSequence *aSeq = [sequenceArray sequenceAtIndex: anIndex]; if (!aSeq) return 0; // rough calculation long long totSize = [aSeq length]; if (!aFlag) { // other strand totSize *= 2; } // suffix array totSize = totSize * 2 * sizeof(int); //printf("totSize: %llu\n", totSize); return totSize; } - (BOOL)checkMemory { int i; long long maxMem; long long totSize = 0; // no sequence then don't need memory if (!sequenceArray) return YES; int cnt = [sequenceArray count]; if (cnt == 0) return YES; BOOL oneStrand; NSString *aStrand = [metaDict objectForKey: @"strand"]; if (!aStrand) oneStrand = NO; else oneStrand = YES; // max memory we should use if (maxMemoryUsage) maxMem = maxMemoryUsage; else maxMem = max_physical_memory(); // rough calculation for all sequences // one strand for (i = 0; i < cnt; ++i) { BCSequence *aSeq = [sequenceArray sequenceAtIndex: i]; totSize += [aSeq length]; ++totSize; // N separator between sequences } if (!oneStrand) { // other strand totSize *= 2; } // suffix array totSize = totSize * 2 * sizeof(int); //printf("totSize: %llu\n", totSize); //printf("maxMem: %llu\n", maxMem); BOOL check = YES; if (totSize > maxMem) check = NO; if (check) { printf("Sufficient memory for all sequences.\n"); memoryState = ALL_SEQS; return YES; } else { // If all sequences will not fit in memory, check individual check = YES; // individual sequences, with however many strands for (i = 0; i < [sequenceArray count]; ++i) { totSize = [self checkMemoryForSequence: i oneStrand: oneStrand]; if (totSize > maxMem) { check = NO; break; } } if (check) { printf("Sufficient memory for one sequence at a time.\n"); memoryState = ONE_SEQ; return YES; } else { // if doing both strands, check on strand at a time if (!oneStrand) { check = YES; for (i = 0; i < [sequenceArray count]; ++i) { totSize = [self checkMemoryForSequence: i oneStrand: YES]; if (totSize > maxMem) { check = NO; break; } } } if (check) { printf("Sufficient memory for one strand at a time.\n"); memoryState = ONE_STRAND; return YES; } } } NSLog(@"Insufficient memory to construct suffix array.\n"); return NO; } - (BOOL)constructMemorySequence { int i, j, totSize = 0; NSString *aStrand = [metaDict objectForKey: @"strand"]; NSMutableArray *seqMeta = [metaDict objectForKey: @"sequences"]; // determine total size of sequences for (i = 0; i < [sequenceArray count]; ++i) { BCSequence *aSeq = [sequenceArray sequenceAtIndex: i]; totSize += [aSeq length]; ++totSize; // N separator between sequences NSMutableDictionary *d = [NSMutableDictionary new]; [d setObject: [NSNumber numberWithInt: [aSeq length]] forKey: @"length"]; [d setObject: [[aSeq annotationForKey: @">"] content] forKey: @"id"]; [seqMeta addObject: d]; } //printf("%d bytes\n", totSize); // allocate memory to create one long sequence // from the concatenation of the sequences if (memSequence) free(memSequence); int n; if (aStrand) n = totSize; else n = 2 * totSize; printf("Allocating %d bytes.\n", n + 2); memSequence = (unsigned char *)malloc(sizeof(unsigned char) * (n + 2)); if (!memSequence) { NSLog(@"Unable to allocate memory.\n"); return NO; } bzero(memSequence, n + 1); // concatenate sequences int curPos = 0; if ((!aStrand) || ([aStrand isEqualToString: @"F"])) { for (i = 0; i < [sequenceArray count]; ++i) { memSequence[curPos++] = BCSUFFIXARRAY_TERM_CHAR; BCSequence *aSeq = [sequenceArray sequenceAtIndex: i]; const unsigned char *seqBytes = [aSeq bytes]; NSMutableDictionary *d = [seqMeta objectAtIndex: i]; [d setObject: [NSNumber numberWithInt: curPos] forKey: @"position"]; for (j = 0; j < [aSeq length]; ++j) { // mask char c = seqBytes[j]; if (!softMask) c = toupper(c); switch (c) { case 'A': memSequence[curPos++] = 'A'; break; case 'T': memSequence[curPos++] = 'T'; break; case 'C': memSequence[curPos++] = 'C'; break; case 'G': memSequence[curPos++] = 'G'; break; default: memSequence[curPos++] = BCSUFFIXARRAY_TERM_CHAR; break; } } } memSequence[curPos] = '\0'; [metaDict setObject: [NSNumber numberWithInt: curPos] forKey: @"length"]; //printf("%d %c %c\n", curPos, memSequence[curPos-1], memSequence[curPos]); } // perform our own reverse complement // to avoid doubling the sequences if (!aStrand) { // calculate reverse strand positions int oldPos = curPos - 1; int nextPos = curPos + 1; for (j = [seqMeta count] - 1; j >= 0; --j) { NSMutableDictionary *d = [seqMeta objectAtIndex: j]; [d setObject: [NSNumber numberWithInt: nextPos] forKey: @"reverse"]; int aPos = [[d objectForKey: @"position"] intValue]; nextPos += oldPos - aPos + 2; oldPos = aPos - 2; } // add reverse strand int k = curPos; memSequence[k] = BCSUFFIXARRAY_TERM_CHAR; ++k; for (j = curPos-1; j >= 0; --j) { switch (memSequence[j]) { case 'A': memSequence[k] = 'T'; break; case 'T': memSequence[k] = 'A'; break; case 'C': memSequence[k] = 'G'; break; case 'G': memSequence[k] = 'C'; break; default: memSequence[k] = BCSUFFIXARRAY_TERM_CHAR; break; } ++k; } memSequence[k] = '\0'; curPos = k; } else if ([aStrand isEqualToString: @"R"]) { // only reverse strand for (i = 0; i < [sequenceArray count]; ++i) { memSequence[curPos++] = BCSUFFIXARRAY_TERM_CHAR; BCSequence *aSeq = [sequenceArray sequenceAtIndex: i]; const unsigned char *seqBytes = [aSeq bytes]; NSMutableDictionary *d = [seqMeta objectAtIndex: i]; [d setObject: [NSNumber numberWithInt: curPos] forKey: @"position"]; for (j = [aSeq length] - 1; j >= 0; --j) { // mask char c = seqBytes[j]; if (!softMask) c = toupper(c); switch (c) { case 'A': memSequence[curPos++] = 'T'; break; case 'T': memSequence[curPos++] = 'A'; break; case 'C': memSequence[curPos++] = 'G'; break; case 'G': memSequence[curPos++] = 'C'; break; default: memSequence[curPos++] = BCSUFFIXARRAY_TERM_CHAR; break; } } } memSequence[curPos] = '\0'; [metaDict setObject: [NSNumber numberWithInt: curPos] forKey: @"length"]; } //printf("total size %d (bp)\n", curPos); //printf("%s\n", memSequence); numOfSuffixes = curPos; return YES; } - (int)sequence:(NSArray *)a forMemoryPosition:(int)position isForward:(BOOL)isForward { int cnt = [a count]; #if 0 printf("position: %d %d\n", position, isForward); #endif // empty array if (cnt == 0) { NSLog(@"ERROR: empty meta data array.\n"); return -1; } // only one sequence //if (cnt == 1) return 0; // Binary search to find start interval int uPos = cnt - 1; int lPos = 0; int startPos = 0; BOOL done = NO; while (!done) { startPos = (uPos + lPos) / 2; #if 0 printf("uPos: %d lPos: %d startPos: %d\n", uPos, lPos, startPos); #endif if (startPos == cnt) break; NSDictionary *d = [a objectAtIndex: startPos]; NSNumber *n; if (isForward) n = [d objectForKey: @"position"]; else n = [d objectForKey: @"reverse"]; if ([n intValue] == position) return startPos; if (isForward) { // array is in ascending order for forward strand if ([n intValue] > position) { uPos = startPos; } else { lPos = startPos; } if (lPos == uPos) { if ([n intValue] <= position) return startPos; else { --lPos; --uPos; } } if ((lPos + 1) == uPos) { lPos = uPos; } } else { // array is in descending order for reverse strand if ([n intValue] > position) { lPos = startPos; } else { uPos = startPos; } if (lPos == uPos) { if ([n intValue] <= position) return startPos; else { ++lPos; ++uPos; } } if ((lPos + 1) == uPos) { uPos = lPos; } } } #if 0 printf("ERROR uPos: %d lPos: %d startPos: %d count: %d\n", uPos, lPos, startPos, cnt); #endif return -1; } // // Build the suffix array // - (BOOL)constructFromSequence:(BCSequence *)aSequence strand:(NSString *)aStrand { printf("Building suffix array.\n"); if (!aSequence) return NO; BCSequenceArray *anArray = [[[BCSequenceArray alloc] init] autorelease]; [anArray addSequence: aSequence]; return [self constructFromSequenceArray: anArray strand: aStrand]; } - (BOOL)constructFromSequenceArray:(BCSequenceArray *)anArray strand:(NSString *)aStrand { if (!anArray) return NO; if ([anArray count] == 0) return NO; if (metaDict) [metaDict release]; metaDict = [NSMutableDictionary new]; if (aStrand) [metaDict setObject: aStrand forKey: @"strand"]; [metaDict setObject: [NSNumber numberWithBool: softMask] forKey: @"softMask"]; NSMutableArray *seqMeta = [NSMutableArray new]; [metaDict setObject: seqMeta forKey: @"sequences"]; // put sequences into memory sequenceArray = [anArray retain]; if (![self checkMemory]) return NO; // TEST #if 0 if ([anArray count] == 1) memoryState = ALL_SEQS; else memoryState = ONE_STRAND; #endif switch (memoryState) { case ALL_SEQS: { // easy, all sequences in memory if (![self constructMemorySequence]) return NO; // allocate memory for suffix array if (suffixArray) { free(suffixArray); suffixArray = NULL; } suffixArray = malloc((numOfSuffixes+1) * sizeof(int)); if (!suffixArray) { NSLog(@"Cannot allocate memory for suffix array.\n"); return NO; } // construct suffix array bsarray(memSequence, suffixArray, numOfSuffixes); break; } case ONE_SEQ: { // construct suffix area for each individual sequence // then we will union them together when write to file int i; char tmpID[7] = {'X', 'X', 'X', 'X', 'X', 'X', 0}; inMemory = NO; mktemp(tmpID); //printf("tmpID: %s\n", tmpID); tmpFile = [NSMutableString stringWithFormat: @"%@/seq.%s", NSTemporaryDirectory(), tmpID]; //printf("tmp file: %s\n", [tmpFile UTF8String]); for (i = 0; i < [sequenceArray count]; ++i) { BCSequence *aSeq = [sequenceArray sequenceAtIndex: i]; BCSuffixArray *sa = [[BCSuffixArray alloc] init]; [sa setSoftMask: softMask]; [sa constructFromSequence: aSeq strand: aStrand]; NSString *s = [NSString stringWithFormat: @"%@.%d", tmpFile, i]; [sa writeToFile: s withMasking: NO]; [sa release]; } break; } case ONE_STRAND: { // construct suffix area for each strand // then we will union them together int i; char tmpID[7] = {'X', 'X', 'X', 'X', 'X', 'X', 0}; //inMemory = NO; mktemp(tmpID); printf("tmpID: %s\n", tmpID); tmpFile = [NSString stringWithFormat: @"%@/seq.%s", NSTemporaryDirectory(), tmpID]; printf("tmp file: %s\n", [tmpFile UTF8String]); for (i = 0; i < [sequenceArray count]; ++i) { BCSequence *aSeq = [sequenceArray sequenceAtIndex: i]; if (aStrand) { // one strand BCSuffixArray *sa = [[BCSuffixArray alloc] init]; [sa setSoftMask: softMask]; [sa constructFromSequence: aSeq strand: aStrand]; NSString *s = [NSString stringWithFormat: @"%@.%d", tmpFile, i]; [sa writeToFile: s withMasking: NO]; [sa release]; } else { // both strands BCSuffixArray *sa = [[BCSuffixArray alloc] init]; [sa setSoftMask: softMask]; [sa constructFromSequence: aSeq strand: @"F"]; NSString *s = [NSString stringWithFormat: @"%@.F.%d", tmpFile, i]; [sa writeToFile: s withMasking: NO]; [sa release]; sa = [[BCSuffixArray alloc] init]; [sa setSoftMask: softMask]; [sa constructFromSequence: aSeq strand: @"R"]; s = [NSString stringWithFormat: @"%@.R.%d", tmpFile, i]; [sa writeToFile: s withMasking: NO]; [sa release]; } } // now union them together break; } } return YES; } - (BOOL)constructFromSequenceFile:(NSString *)aPath strand:(NSString *)aStrand { if (!aPath) return NO; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; BCSequenceArray *anArray = [sequenceReader readFileUsingPath: aPath]; if ([anArray count] == 0) { NSLog(@"Could not read sequence file.\n"); return NO; } if ([self constructFromSequenceArray: anArray strand: aStrand]) { [metaDict setObject: aPath forKey: @"sequences file"]; return YES; } else return NO; } - (void)buildReverseComplementArray { int cnt = [sequenceArray count]; int i; if (reverseComplementArray) [reverseComplementArray release]; reverseComplementArray = [[BCSequenceArray alloc] init]; for (i = 0; i < cnt; ++i) { BCSequence *aSeq = [sequenceArray sequenceAtIndex: i]; int j; char *seqData = (char *)[[aSeq sequenceData] bytes]; int seqLen = [aSeq length]; char *revData = (char *)malloc(seqLen * sizeof(char)); for (j = 0; j < seqLen; ++j) { char c = seqData[j]; switch (c) { case 'a': c = 't'; break; case 't': c = 'a'; break; case 'c': c = 'g'; break; case 'g': c = 'c'; break; case 'A': c = 'T'; break; case 'T': c = 'A'; break; case 'C': c = 'G'; break; case 'G': c = 'C'; break; default: break; } revData[seqLen - j - 1] = c; } NSData *finalData = [NSData dataWithBytes: revData length: seqLen]; BCSequence *newSequence = [[BCSequence alloc] initWithData: finalData symbolSet: [BCSymbolSet dnaSymbolSet]]; [reverseComplementArray addSequence: newSequence]; } } // internal method, load suffix array meta data from disk - (BOOL)loadFromFile:(NSString *)aPath inMemory:(BOOL)aFlag { inMemory = aFlag; // read meta file NSString *metaFile = [aPath stringByAppendingPathExtension: @"meta_sa"]; metaDict = [[NSMutableDictionary alloc] initWithContentsOfFile: metaFile]; if (!metaDict) { NSLog(@"Failed to load meta-data file: %@\n", metaFile); return NO; } // flags NSNumber *n = [metaDict objectForKey: @"softMask"]; if (n) softMask = [n boolValue]; // fix up paths dirPath = [[metaFile stringByDeletingLastPathComponent] retain]; NSString *s = [metaDict objectForKey: @"suffix array file"]; if (!s) { NSLog(@"Meta-data file is corrupt, missing path to 'suffix array file'.\n"); return NO; } if (![s isAbsolutePath]) { s = [dirPath stringByAppendingPathComponent: s]; [metaDict setObject: s forKey: @"suffix array file"]; } // load up suffix array into memory if (inMemory) { NSLog(@"Loading suffix array into memory not currently supported."); } return YES; } - initWithContentsOfFile:(NSString *)aPath forSequence:(BCSequence *)aSequence inMemory:(BOOL)aFlag { if (!aSequence) return NO; BCSequenceArray *anArray = [[[BCSequenceArray alloc] init] autorelease]; [anArray addSequence: aSequence]; return [self initWithContentsOfFile: aPath forSequenceArray: anArray inMemory: aFlag]; } - initWithContentsOfFile:(NSString *)aPath forSequenceArray:(BCSequenceArray *)anArray inMemory:(BOOL)aFlag { [super init]; if (![self loadFromFile: aPath inMemory: aFlag]) return nil; sequenceArray = anArray; [self buildReverseComplementArray]; return self; } - initWithContentsOfFile:(NSString *)aPath inMemory:(BOOL)aFlag { [super init]; if (![self loadFromFile: aPath inMemory: aFlag]) return nil; NSString *s = [metaDict objectForKey: @"sequences file"]; if (!s) { NSLog(@"Meta-data file is corrupt, missing path to 'sequences file'.\n"); return nil; } if (![s isAbsolutePath]) { s = [dirPath stringByAppendingPathComponent: s]; [metaDict setObject: s forKey: @"sequences file"]; } // load up sequences s = [metaDict objectForKey: @"sequences file"]; BCSequenceReader *sequenceReader = [[[BCSequenceReader alloc] init] autorelease]; sequenceArray = [sequenceReader readFileUsingPath: s]; [self buildReverseComplementArray]; //if (![self constructMemorySequence]) return nil; return self; } // // Suffix array file operations // - (BOOL)memoryWriteToFile:(NSString *)aPath withMasking:(BOOL)aFlag { int i, j; if (!memSequence) return NO; if (!aPath) return NO; // save size int totSize = [[metaDict objectForKey: @"length"] intValue]; // write meta file NSString *saFile = [aPath stringByAppendingPathExtension: @"sa"]; [metaDict setObject: saFile forKey: @"suffix array file"]; NSString *metaFile = [aPath stringByAppendingPathExtension: @"meta_sa"]; NSArray *seqMeta = [metaDict objectForKey: @"sequences"]; int totLength = 0; NSMutableArray *newSeqMeta = [NSMutableArray new]; for (j = 0; j < [seqMeta count]; ++j) { NSDictionary *d = [seqMeta objectAtIndex: j]; NSMutableDictionary *nd = [NSMutableDictionary dictionaryWithDictionary: d]; [nd setObject: [NSNumber numberWithInt: j] forKey: @"number"]; [nd removeObjectForKey: @"position"]; [nd removeObjectForKey: @"reverse"]; totLength += [[d objectForKey: @"length"] intValue]; [newSeqMeta addObject: nd]; } [metaDict setObject: [NSNumber numberWithInt: totLength] forKey: @"length"]; [metaDict setObject: newSeqMeta forKey: @"sequences"]; [metaDict setObject: [NSNumber numberWithBool: softMask] forKey: @"softMask"]; [metaDict writeToFile: metaFile atomically: YES]; FILE *g1 = fopen([saFile UTF8String], "w"); if (!g1) { NSLog(@"Could not open file: %s\n", [saFile UTF8String]); return NO; } //fprintf(g1, "1\n"); //fprintf(g1, "%s\n", [[metaFile lastPathComponent] cString]); for (i = 0; i <= numOfSuffixes; ++i) { int sid = 0; int suffixPos = suffixArray[i]; char c = memSequence[suffixArray[i]]; // skip separator chars if ((c != 'A') && (c != 'C') && (c != 'G') && (c != 'T')) continue; if (suffixPos > totSize) { sid = [self sequence: seqMeta forMemoryPosition: suffixPos isForward: NO]; NSDictionary *d = [seqMeta objectAtIndex: sid]; NSNumber *length = [d objectForKey: @"length"]; NSNumber *reverse = [d objectForKey: @"reverse"]; suffixPos = suffixPos - [reverse intValue] + [length intValue]; } else { sid = [self sequence: seqMeta forMemoryPosition: suffixPos isForward: YES]; NSDictionary *d = [seqMeta objectAtIndex: sid]; NSNumber *position = [d objectForKey: @"position"]; suffixPos = suffixPos - [position intValue]; } fwrite(&suffixPos, sizeof(int), 1, g1); fwrite(&sid, sizeof(int), 1, g1); } fclose(g1); return YES; } - (BOOL)fileWriteToFile:(NSString *)aPath withMasking:(BOOL)aFlag { int i, j, k; if (!tmpFile) return NO; if (!aPath) return NO; // Load up each individual suffix array // from its temporary file int totLength = 0; NSMutableArray *newSeqMeta = [NSMutableArray new]; NSMutableArray *tmpSA = [NSMutableArray array]; k = 0; for (i = 0; i < [sequenceArray count]; ++i) { BCSequence *aSeq = [sequenceArray sequenceAtIndex: i]; NSString *s = [NSString stringWithFormat: @"%@.%d", tmpFile, i]; BCSuffixArray *sa = [[BCSuffixArray alloc] initWithContentsOfFile: s forSequence: aSeq inMemory: NO]; [tmpSA addObject: sa]; // copy meta dictionary for sequences in each suffix array NSDictionary *mDict = [sa metaDictionary]; NSArray *seqMeta = [mDict objectForKey: @"sequences"]; for (j = 0; j < [seqMeta count]; ++j) { NSDictionary *d = [seqMeta objectAtIndex: j]; NSMutableDictionary *nd = [NSMutableDictionary dictionaryWithDictionary: d]; [nd setObject: [NSNumber numberWithInt: k] forKey: @"number"]; ++k; [nd removeObjectForKey: @"position"]; [nd removeObjectForKey: @"reverse"]; totLength += [[d objectForKey: @"length"] intValue]; [newSeqMeta addObject: nd]; } } // write meta file NSString *saFile = [aPath stringByAppendingPathExtension: @"sa"]; [metaDict setObject: saFile forKey: @"suffix array file"]; NSString *metaFile = [aPath stringByAppendingPathExtension: @"meta_sa"]; [metaDict setObject: [NSNumber numberWithInt: totLength] forKey: @"length"]; [metaDict setObject: newSeqMeta forKey: @"sequences"]; [metaDict setObject: [NSNumber numberWithBool: softMask] forKey: @"softMask"]; [metaDict writeToFile: metaFile atomically: YES]; FILE *g1 = fopen([saFile UTF8String], "w"); if (!g1) { NSLog(@"Could not open file: %s\n", [saFile UTF8String]); return NO; } // now union temporary suffix arrays together // and write to final file // TODO: not handling multiple files/sequences in a suffix array! // TODO: need to calculate proper sequence number int sa1Offset, sa1File, sa1Array; BCSuffixArrayUnionEnumerator *sae = [[BCSuffixArrayUnionEnumerator alloc] initWithSuffixArrays: tmpSA]; while ([sae nextSuffixPosition:&sa1Offset sequence:&sa1File suffixArray:&sa1Array]) { fwrite(&sa1Offset, sizeof(int), 1, g1); fwrite(&sa1Array, sizeof(int), 1, g1); } fclose(g1); // delete the temporary files NSFileManager *fm = [NSFileManager defaultManager]; for (i = 0; i < [sequenceArray count]; ++i) { NSString *s = [NSString stringWithFormat: @"%@.%d.sa", tmpFile, i]; [fm removeFileAtPath: s handler: nil]; s = [NSString stringWithFormat: @"%@.%d.meta_sa", tmpFile, i]; [fm removeFileAtPath: s handler: nil]; } tmpFile = nil; return YES; } - (BOOL)writeToFile:(NSString *)aPath withMasking:(BOOL)aFlag { if (inMemory) return [self memoryWriteToFile: aPath withMasking: aFlag]; else return [self fileWriteToFile: aPath withMasking: aFlag]; } - (FILE *)getFILE { if (!metaDict) return NULL; NSString *s = [metaDict objectForKey: @"suffix array file"]; if (!s) return NULL; FILE *sa = fopen([s UTF8String], "r"); return sa; } // // Accessor methods // - (int)numberOfSequences { return [sequenceArray count]; } - (int)numOfSuffixes { return numOfSuffixes; } - (const int *)suffixArray { return suffixArray; } - (unsigned char *)memoryForSequence:(int)aNum { return memSequence; } - (BCSequenceArray *)sequenceArray { return sequenceArray; } - (BCSequenceArray *)reverseComplementArray { return reverseComplementArray; } - (NSDictionary *)metaDictionary { return metaDict; } - (BOOL)softMask { return softMask; } - (void)setSoftMask: (BOOL)aFlag { softMask = aFlag; } // // Debugging methods // - (void)dumpSuffixArray { //if (!memSequence) return; if (inMemory) { int i; for (i = 0; i <= numOfSuffixes; ++i) { printf("offset: %d seq: ", suffixArray[i]); int seqLen = 0; while ((suffixArray[i] + seqLen) < numOfSuffixes) { printf("%c", memSequence[suffixArray[i] + seqLen]); ++seqLen; if (seqLen > 50) { printf(" ... "); break; } } printf("\n"); } } else { FILE *sa1 = [self getFILE]; if (!sa1) return; int sa1Offset, sa1File; fread(&sa1Offset, sizeof(int), 1, sa1); fread(&sa1File, sizeof(int), 1, sa1); while (!feof(sa1)) { BCSequence *aSeq = [sequenceArray sequenceAtIndex: sa1File]; BCSequence *revSeq = [reverseComplementArray sequenceAtIndex: sa1File]; BCAnnotation *anno = [aSeq annotationForKey: @">"]; int seqLen = [aSeq length]; //int revLen = 2 * seqLen; //printf("%d\n", seqLen); char *seqData; int seqStart = 0; if (sa1Offset < seqLen) { // forward strand printf("offset: %d strand: F id: %s\n", sa1Offset, [[anno stringValue] UTF8String]); seqData = (char *)[[aSeq sequenceData] bytes]; seqStart = sa1Offset; } else { // reverse strand printf("offset: %d strand: R id: %s\n", sa1Offset, [[anno stringValue] UTF8String]); seqData = (char *)[[revSeq sequenceData] bytes]; seqStart = sa1Offset - seqLen; } int seqPos = 0; while ((seqStart + seqPos) < seqLen) { printf("%c", seqData[seqStart + seqPos]); ++seqPos; if (seqPos > 50) { printf(" ... "); break; } } printf("\n"); // next sequence fread(&sa1Offset, sizeof(int), 1, sa1); fread(&sa1File, sizeof(int), 1, sa1); } fclose(sa1); } } - (void)dumpSuffixArrayForSequence:(int)aSeq position:(int)aPos length:(int)aLen; { BCSequence *forSeq = [sequenceArray sequenceAtIndex: aSeq]; if (!forSeq) return; BCAnnotation *anno = [forSeq annotationForKey: @">"]; BCSequence *revSeq = [reverseComplementArray sequenceAtIndex: aSeq]; int seqLen = [forSeq length]; const char *seqData; int seqStart = 0; if (aPos < seqLen) { // forward strand printf("offset: %d strand: F id: %s\n", aPos, [[anno stringValue] UTF8String]); seqData = [[forSeq sequenceData] bytes]; seqStart = aPos; } else { // reverse strand printf("offset: %d strand: R id: %s\n", aPos, [[anno stringValue] UTF8String]); seqData = [[revSeq sequenceData] bytes]; seqStart = aPos - seqLen; } int seqPos = 0; while ((seqStart + seqPos) < seqLen) { printf("%c", seqData[seqStart + seqPos]); ++seqPos; if (seqPos == aLen) break; } printf("\n"); } @end // // Suffix array routines // These are made internal functions // /* int sarray(int a[], int n) Purpose Return in a[] a suffix array for the original contents of a[]. (The original values in a[] are typically serial numbers of distinct tokens in some list.) Precondition Array a[] holds n values, with n>=1. Exactly k distinct values, in the range 0..k-1, are present. Value 0, an endmark, appears exactly once, at a[n-1]. Postcondition Array a[] is a copy of the internal array p[] that records the sorting permutation: if i #include typedef unsigned char uchar; #define pred(i, h) ((t=(i)-(h))<0? t+n: t) #define succ(i, h) ((t=(i)+(h))>=n? t-n: t) enum { BUCK = ~(~0u>>1), /* high bit */ MAXI = ~0u>>1, /* biggest int */ }; static void qsort2(int*, int*, int n); static int ssortit(int a[], int p[], int n, int h, int *pe, int nbuck); #if 0 // not currently used static int sarray(int a[], int n) { int i, l; int c, cc, ncc, lab, cum, nbuck; int k; int *p = 0; int result = -1; int *al; int *pl; for(k=0,i=0; i k) k = a[i]; /* max element */ k++; if(k>n) goto out; nbuck = 0; p = malloc(n*sizeof(int)); if(p == 0) goto out; pl = p + n - k; al = a; memset(pl, -1, k*sizeof(int)); for(i=0; i= 0; i--){ c = (buf[i] << 8) | (c >> 8); a[i] = buckets[c]; buckets[c] = i; } /* * end of string comes before anything else */ a[n] = 0; lab = 1; cum = 1; i = 0; nbuck = 0; for(c = 0; c < 256*256; c++) { /* * last character is followed by unique end of string */ if(c == last) { a[n-1] = lab; cum++; lab++; } for(cc = buckets[c]; cc != -1; cc = ncc) { ncc = a[cc]; a[cc] = lab; cum++; p[i++] = cc; } if(lab == cum) continue; if(lab + 1 == cum) i--; else { p[i - 1] |= BUCK; nbuck++; } lab = cum; } id = ssortit(a, p, n+1, 2, p+i, nbuck); free(a); return id; } static int ssortit(int a[], int p[], int n, int h, int *pe, int nbuck) { int *s, *ss, *packing, *sorting; int v, sv, vv, packed, lab, t, i; for(; h < n && p < pe; h=2*h) { packing = p; nbuck = 0; for(sorting = p; sorting < pe; sorting = s){ /* * find length of stuff to sort */ lab = a[*sorting]; for(s = sorting; ; s++) { sv = *s; v = a[succ(sv & ~BUCK, h)]; if(v & BUCK) v = lab; a[sv & ~BUCK] = v | BUCK; if(sv & BUCK) break; } *s++ &= ~BUCK; nbuck++; qsort2(sorting, a, s - sorting); v = a[*sorting]; a[*sorting] = lab; packed = 0; for(ss = sorting + 1; ss < s; ss++) { sv = *ss; vv = a[sv]; if(vv == v) { *packing++ = ss[-1]; packed++; } else { if(packed) { *packing++ = ss[-1] | BUCK; } lab += packed + 1; packed = 0; v = vv; } a[sv] = lab; } if(packed) { *packing++ = ss[-1] | BUCK; } } pe = packing; } /* * reconstuct the permutation matrix * return index of the entire string */ v = a[0]; for(i = 0; i < n; i++) p[a[i]] = i; return v; } /* * qsort from Bentley and McIlroy, Software--Practice and Experience 23 (1993) 1249-1265, specialized for sorting permutations based on successors */ static void vecswap2(int *a, int *b, int n) { while (n-- > 0) { int t = *a; *a++ = *b; *b++ = t; } } #define swap2(a, b) { t = *(a); *(a) = *(b); *(b) = t; } static int* med3(int *a, int *b, int *c, int *asucc) { int va, vb, vc; if ((va=asucc[*a]) == (vb=asucc[*b])) return a; if ((vc=asucc[*c]) == va || vc == vb) return c; return va < vb ? (vb < vc ? b : (va < vc ? c : a)) : (vb > vc ? b : (va < vc ? a : c)); } static void inssort(int *a, int *asucc, int n) { int *pi, *pj, t; for (pi = a + 1; --n > 0; pi++) for (pj = pi; pj > a; pj--) { if(asucc[pj[-1]] <= asucc[*pj]) break; swap2(pj, pj-1); } } static void qsort2(int *a, int *asucc, int n) { int d, r, partval; int *pa, *pb, *pc, *pd, *pl, *pm, *pn, t; if (n < 15) { inssort(a, asucc, n); return; } pl = a; pm = a + (n >> 1); pn = a + (n-1); if (n > 30) { /* On big arrays, pseudomedian of 9 */ d = (n >> 3); pl = med3(pl, pl+d, pl+2*d, asucc); pm = med3(pm-d, pm, pm+d, asucc); pn = med3(pn-2*d, pn-d, pn, asucc); } pm = med3(pl, pm, pn, asucc); swap2(a, pm); partval = asucc[*a]; pa = pb = a + 1; pc = pd = a + n-1; for (;;) { while (pb <= pc && (r = asucc[*pb]-partval) <= 0) { if (r == 0) { swap2(pa, pb); pa++; } pb++; } while (pb <= pc && (r = asucc[*pc]-partval) >= 0) { if (r == 0) { swap2(pc, pd); pd--; } pc--; } if (pb > pc) break; swap2(pb, pc); pb++; pc--; } pn = a + n; r = pa-a; if(pb-pa < r) r = pb-pa; vecswap2(a, pb-r, r); r = pn-pd-1; if(pd-pc < r) r = pd-pc; vecswap2(pb, pn-r, r); if ((r = pb-pa) > 1) qsort2(a, asucc, r); if ((r = pd-pc) > 1) qsort2(a + n-r, asucc, r); } // Get #ifdef __APPLE__ #include #include static long long max_physical_memory() { #if 1 int mib[2]; size_t len; unsigned int *p; long long max; mib[0] = CTL_HW; mib[1] = HW_PHYSMEM; sysctl(mib, 2, NULL, &len, NULL, 0); p = malloc(len); sysctl(mib, 2, p, &len, NULL, 0); // leave 100Mb spare max = (long long)*p; max = max - 100000000; free(p); return max; #else // actual physical memory int ret; size_t oldlen; uint64_t physmem_size; oldlen = sizeof(physmem_size); ret = sysctlbyname("hw.memsize", &physmem_size, &oldlen, NULL, 0); return physmem_size; #endif } #else // not __APPLE__ // should work for Linux systems with /proc/meminfo static long long max_physical_memory() { long long availMem = 0; NSFileManager *fileManager = [NSFileManager defaultManager]; if ([fileManager fileExistsAtPath: @"/proc/meminfo"]) { NSString *memInfo = [NSString stringWithContentsOfFile: @"/proc/meminfo"]; NSRange r = [memInfo rangeOfString: @"MemTotal:"]; if (r.location == NSNotFound) { NSLog(@"Cannot determine amount of physical memory."); return 0; } NSString *s = [[memInfo substringFromIndex: (r.location + r.length)] stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSArray *a = [s componentsSeparatedByString: @" "]; s = [a objectAtIndex: 0]; availMem = [s intValue]; availMem *= 1024; } else { NSLog(@"Cannot determine amount of physical memory."); } return availMem; } #endif // // Suffix array enumeration classes // @implementation BCSuffixArrayUnionEnumerator - initWithSuffixArrays:(NSArray *)arrays { [super init]; if ([arrays count] == 0) return nil; suffixArrays = [arrays retain]; suffixPositions = (int *)malloc(sizeof(int) * [suffixArrays count]); suffixSequences = (int *)malloc(sizeof(int) * [suffixArrays count]); saSeqs = (BCSequenceArray **)malloc(sizeof(BCSequenceArray *) * [suffixArrays count]); saRevs = (BCSequenceArray **)malloc(sizeof(BCSequenceArray *) * [suffixArrays count]); arrayFiles = (FILE **)malloc(sizeof(FILE *) * [suffixArrays count]); eofFlags = (BOOL *)malloc(sizeof(BOOL) * [suffixArrays count]); int i; for (i = 0; i < [suffixArrays count]; ++i) { suffixPositions[i] = -1; arrayFiles[i] = NULL; eofFlags[i] = NO; BCSuffixArray *sa = [suffixArrays objectAtIndex: i]; saSeqs[i] = [sa sequenceArray]; saRevs[i] = [sa reverseComplementArray]; } currentSuffix = -1; currentArray = nil; return self; } - (void)dealloc { if (suffixPositions) free(suffixPositions); if (suffixSequences) free(suffixSequences); if (saSeqs) free(saSeqs); if (saRevs) free(saRevs); if (arrayFiles) { int i; for (i = 0; i < [suffixArrays count]; ++i) fclose(arrayFiles[i]); free(arrayFiles); } [suffixArrays release]; [super dealloc]; } - (BOOL)nextSuffixPosition:(int *)aPos sequence:(int *)aSeq suffixArray:(int *)anArray { int i; // if haven't started yet or at the end // setup files and read in first suffixes if (currentSuffix < 0) { for (i = 0; i < [suffixArrays count]; ++i) { if (arrayFiles[i]) { rewind(arrayFiles[i]); } else { BCSuffixArray *sa = [suffixArrays objectAtIndex: i]; arrayFiles[i] = [sa getFILE]; } } // read in first suffix for each suffix array for (i = 0; i < [suffixArrays count]; ++i) { fread(&(suffixPositions[i]), sizeof(int), 1, arrayFiles[i]); fread(&(suffixSequences[i]), sizeof(int), 1, arrayFiles[i]); } } // determine EOF conditions int cnt = [suffixArrays count]; BOOL allEOF = YES; for (i = 0; i < cnt; ++i) { if (feof(arrayFiles[i])) { eofFlags[i] = YES; } else { eofFlags[i] = NO; } allEOF &= eofFlags[i]; } // all EOF then done if (allEOF) { currentSuffix = -1; return NO; } // get sequence data for each suffix array BCSequence *seqs[cnt]; int seqPos[cnt]; int seqLen[cnt]; for (i = 0; i < cnt; ++i) { seqs[i] = [saSeqs[i] sequenceAtIndex: suffixSequences[i]]; seqLen[i] = [seqs[i] length]; if (suffixPositions[i] < seqLen[i]) { // forward strand seqPos[i] = suffixPositions[i]; } else { // reverse strand seqPos[i] = suffixPositions[i] - seqLen[i]; seqs[i] = [saRevs[i] sequenceAtIndex: suffixSequences[i]]; } } // get initial for (i = 0; i < cnt; ++i) { if (!eofFlags[i]) { currentSuffix = i; break; } } // union of the suffixes to determine which is lexigraphically first for (i = currentSuffix + 1; i < cnt; ++i) { if (eofFlags[i]) continue; const char *currentData = [[seqs[currentSuffix] sequenceData] bytes]; const char *checkData = [[seqs[i] sequenceData] bytes]; int currentPos = 0; int offsetToWrite = 0; BOOL done = NO; while (!done) { // check EOF conditions if ((seqPos[currentSuffix] + currentPos) >= seqLen[currentSuffix]) { if ((seqPos[i] + currentPos) >= seqLen[i]) { // both at EOF, so strings must be identical done = YES; offsetToWrite = 3; continue; } // EOF for first sequence, it is lower done = YES; offsetToWrite = 1; continue; } if ((seqPos[i] + currentPos) >= seqLen[i]) { // EOF for second sequence, it is lower done = YES; offsetToWrite = 2; continue; } char c1 = currentData[seqPos[currentSuffix] + currentPos]; char c2 = checkData[seqPos[i] + currentPos]; ++currentPos; //printf("%c(%d) %c(%d)\n", c1, currentSuffix, c2, i); // stop at invalid characters if ((c1 != 'A') && (c1 != 'C') && (c1 != 'G') && (c1 != 'T')) { done = YES; offsetToWrite = 1; continue; } if ((c2 != 'A') && (c2 != 'C') && (c2 != 'G') && (c2 != 'T')) { done = YES; offsetToWrite = 2; continue; } if (c1 == c2) continue; if (c1 > c2) { done = YES; offsetToWrite = 2; } else { done = YES; offsetToWrite = 1; } } switch(offsetToWrite) { case 1: // current is lower so keep it break; case 2: // other sequence is lower currentSuffix = i; break; case 3: // identical so keep the current break; default: NSLog(@"ERROR: invalid result %d\n", offsetToWrite); return NO; } } // provide return values if (aPos) *aPos = suffixPositions[currentSuffix]; if (aSeq) *aSeq = suffixSequences[currentSuffix]; if (anArray) *anArray = currentSuffix; //printf("%d %d %d\n", *aPos, *aSeq, *anArray); // move forward for the current suffix fread(&(suffixPositions[currentSuffix]), sizeof(int), 1, arrayFiles[currentSuffix]); fread(&(suffixSequences[currentSuffix]), sizeof(int), 1, arrayFiles[currentSuffix]); //printf("%d %d\n", suffixPositions[currentSuffix], suffixSequences[currentSuffix]); return YES; } - (NSArray *)suffixArrays { return suffixArrays; } @end biococoa-2.2.2/BCFoundation/BCAnalysis/GNUmakefile000644 000765 000024 00000003630 11226023231 022304 0ustar00scottcstaff000000 000000 # # GNUmakefile # # Written by: Scott Christley # Copyright (c) 2003-2009 The BioCocoa Project. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # include $(GNUSTEP_MAKEFILES)/common.make # The library to be compiled SUBPROJECT_NAME = BCAnalysis # The Objective-C source files to be compiled BCAnalysis_OBJC_FILES = \ BCMCP.m \ BCSuffixArray.m BCAnalysis_HEADER_FILES = \ BCMCP.h \ BCSuffixArray.h BIOCOCOA_BASE_DIR = .. -include $(BIOCOCOA_BASE_DIR)/GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble biococoa-2.2.2/BCFoundation/BCAlignment/BCPairwiseAlignment.h000644 000765 000024 00000003655 11223237412 024401 0ustar00scottcstaff000000 000000 // // BCPairwiseAlignment.h // BioCocoa // // Created by Philipp Seibel on 10.03.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import #import "BCSequence.h" #import "BCAlignment.h" #import "BCScoreMatrix.h" @interface BCPairwiseAlignment : NSObject + (BCAlignment *)needlemanWunschAlignmentWithSequences:(NSArray *)theSequences properties:(NSDictionary *)properties; + (BCAlignment *)smithWatermanAlignmentWithSequences:(NSArray *)theSequences properties:(NSDictionary *)properties; @end biococoa-2.2.2/BCFoundation/BCAlignment/BCPairwiseAlignment.m000644 000765 000024 00000014163 11223237412 024402 0ustar00scottcstaff000000 000000 // // BCPairwiseAlignment.m // BioCocoa // // Created by Philipp Seibel on 10.03.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCSequenceAlignment.h" #import "BCStringDefinitions.h" #define DIAG (idxB - 1) * lenA + (idxA - 1) #define LEFT idxB * lenA + (idxA - 1) #define UP (idxB - 1) * lenA + idxA //Pointer for backtracking matrix typedef enum { kNone = 0, kDiagonal, kLeft, kUp } Pointers; @interface BCSequenceAlignment ( PairwiseAlignment_Private ) @end @implementation BCSequenceAlignment ( PairwiseAlignment ) + (BCSequenceAlignment *)needlemanWunschAlignmentWithSequences:(NSArray *)theSequences properties:(NSDictionary *)properties { // obtaining substitution matrix BCScoreMatrix *substitutionMatrix = [properties objectForKey: BCSubstitutionMatrixProperty]; // sequences BCSequence *sequenceA = [theSequences objectAtIndex:0]; BCSequence *sequenceB = [theSequences objectAtIndex:1]; // converting sequences to c char pointer const char * seqA = [[sequenceA sequenceString] UTF8String]; const char * seqB = [[sequenceB sequenceString] UTF8String]; // currently only default gap penalties possible int gapCosts = [(NSNumber *)[properties objectForKey: BCDefaultGapPenaltyProperty] intValue]; unsigned int lenA = [sequenceA length]; unsigned int lenB = [sequenceB length]; // initialize matrices int *backtracking = (int *)malloc( sizeof( int ) * ( lenA + 1 ) * ( lenB + 1 ) ); int *dynMatrix = (int *)malloc( sizeof( int ) * ( lenA + 1 ) * ( lenB + 1 ) ); unsigned int idxA; unsigned int idxB; // upper left corner dynMatrix[ 0 ] = [substitutionMatrix substituteChar:seqA[0] forChar:seqB[0]]; backtracking[ 0 ] = kNone; // initialize first column & row for ( idxA = 1; idxA <= lenA; idxA++ ) { backtracking[ idxA ] = kLeft; dynMatrix[ idxA ] = idxA * gapCosts; } for ( idxB = 1; idxB <= lenB; idxB++ ) { backtracking[ idxB * lenA ] = kUp; dynMatrix[ idxB * lenA ] = idxB * gapCosts; } // dynamic programming -- filling up the matrix for ( idxA = 1; idxA <= lenA; idxA++ ) { for ( idxB = 1; idxB <= lenB; idxB++ ) { unsigned int currPos = idxB * lenA + idxA; int substitutionScore = [substitutionMatrix substituteChar:seqA[idxA - 1] forChar:seqB[idxB - 1]]; int diagScore = dynMatrix[ DIAG ] + substitutionScore; int rightScore = dynMatrix[ LEFT ] + gapCosts; int downScore = dynMatrix[ UP ] + gapCosts; // looking for the direction with the highest score // storing direction in backtracking matrix if ( diagScore >= rightScore ) { if ( diagScore > downScore ) { backtracking[ currPos ] = kDiagonal; dynMatrix[ currPos ] = diagScore; } else { backtracking[ currPos ] = kUp; dynMatrix[ currPos ] = downScore; } } else { if ( rightScore > downScore ) { backtracking[ currPos ] = kLeft; dynMatrix[ currPos ] = rightScore; } else { backtracking[ currPos ] = kUp; dynMatrix[ currPos ] = downScore; } } } } // preparing for the walk back through the backtracking matrix int i = lenA; int j = lenB; int k = 0; char *a = ( char * ) malloc( (lenA + lenB) * sizeof(char)); char *b = ( char * ) malloc( (lenA + lenB) * sizeof(char)); // walk back and build up the alignment while ( backtracking[j * lenA + i ] != kNone ) { switch(backtracking[j * lenA + i ]){ case kDiagonal : a[k] = seqA[i - 1]; b[k] = seqB[j - 1]; i--; j--; k++; break; case kLeft : a[k] = seqA[i - 1]; b[k] = '-'; i--; k++; break; case kUp : a[k] = '-'; b[k] = seqB[j - 1]; j--; k++; break; } } // get the reverse versions ( form tail > head to head > tail ) char *an = (char *)malloc( sizeof(char) * k ); char *bn = (char *)malloc( sizeof(char) * k ); for(i=k-1;i>=0;i--) an[k-i-1] = a[i]; for(j=k-1;j>=0;j--) bn[k-j-1] = b[j]; // converting back to objc class // to prevent a compiler warning, the usingType argument has been removed - this needs to be reviewed // BCSequence *alnA = [BCSequence sequenceWithString:[NSString stringWithCString:an length:k] usingType:BCSequenceTypeOther]; // BCSequence *alnB = [BCSequence sequenceWithString:[NSString stringWithCString:bn length:k] usingType:BCSequenceTypeOther]; BCSequence *alnA = [BCSequence sequenceWithString:[NSString stringWithCString:an length:k]]; BCSequence *alnB = [BCSequence sequenceWithString:[NSString stringWithCString:bn length:k]]; //building up the alignment return [[[BCSequenceAlignment alloc] initWithSequenceArray:[NSArray arrayWithObjects:alnA,alnB,nil]] autorelease]; } + (BCSequenceAlignment *)smithWatermanAlignmentWithSequences:(NSArray *)theSequences properties:(NSDictionary *)properties { return nil; } @end biococoa-2.2.2/BCFoundation/BCAlignment/BCScoreMatrix.h000644 000765 000024 00000003722 11223237412 023212 0ustar00scottcstaff000000 000000 // // BCScoreMatrix.h // BioCocoa // // Created by Philipp Seibel on 10.03.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import #import "BCSymbol.h" #import "BCSymbolSet.h" @interface BCScoreMatrix : NSObject { NSArray *symbols; int symbolCount; int *scoreMatrix; } - (id)initWithSymbolSet:(BCSymbolSet *)symbolSet matrix:(int *)aMatrix; - (BOOL)containsSymbol:(BCSymbol *)aSymbol; - (int)substituteSymbol:(BCSymbol *)symbolA forSymbol:(BCSymbol *)symbolB; - (int)substituteChar:(char)charA forChar:(char)charB; @end biococoa-2.2.2/BCFoundation/BCAlignment/BCScoreMatrix.m000644 000765 000024 00000004726 11223237412 023224 0ustar00scottcstaff000000 000000 // // BCScoreMatrix.m // BioCocoa // // Created by Philipp Seibel on 10.03.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCScoreMatrix.h" @implementation BCScoreMatrix - (id)initWithSymbolSet:(BCSymbolSet *)symbolSet matrix:(int *)aMatrix { self = [super init]; if ( self ) { symbols = [symbolSet allSymbols]; symbolCount = [symbols count]; scoreMatrix = (int *)malloc( sizeof( int ) * 128 * 128 ); memcpy( scoreMatrix, aMatrix, sizeof( int ) * 128 * 128 ); } return self; } - (BOOL)containsSymbol:(BCSymbol *)aSymbol { return [symbols containsObject: aSymbol]; } - (int)substituteSymbol:(BCSymbol *)symbolA forSymbol:(BCSymbol *)symbolB { if ( ![self containsSymbol:symbolA] || ![self containsSymbol:symbolB] ) { // handle wrong symbols !!! } char idxA = [symbolA symbolChar]; char idxB = [symbolB symbolChar]; return [self substituteChar:idxA forChar:idxB]; } - (int)substituteChar:(char)charA forChar:(char)charB { return scoreMatrix[ charA * 128 + charB ]; } - (void)dealloc { [symbols release]; [super dealloc]; } @end biococoa-2.2.2/BCFoundation/BCAlignment/BCSequenceAlignment.h000644 000765 000024 00000007635 11223237412 024370 0ustar00scottcstaff000000 000000 // // BCSequenceAlignment.h // BioCocoa // // Created by Philipp Seibel on 09.03.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Provides alignment of sequences. */ #import #import "BCSequence.h" #import "BCScoreMatrix.h" @class BCSymbolSet, BCAnnotation; /*! @class BCSequenceAlignment @abstract Represents an alignment of BCSequences @discussion */ @interface BCSequenceAlignment : NSObject { NSArray *sequenceArray; } - (id)initWithSequenceArray:(NSArray *)theSequenceArray; @end /*! @category BCSequenceAlignment(AlignmentQuerying) @abstract Obtain sequence alignment information */ @interface BCSequenceAlignment ( AlignmentQuerying ) /*! @method sequenceAtIndex: @abstract obtaining the BCSequence at the given index @discussion */ - (BCSequence *)sequenceAtIndex:(unsigned int)aIndex; /*! @method alignmentInRange: @abstract returns a subalignment @discussion */ - (BCSequenceAlignment *)alignmentInRange:(NSRange)aRange; /*! @method symbolsForColumnAtIndex: @abstract returns a NSArray containing the symbols at the given alignment column @discussion */ - (NSArray *)symbolsForColumnAtIndex:(unsigned int)aColumn; /*! @method length @abstract obtaining the length of the alignment @discussion */ - (unsigned int)length; - (unsigned int)sequenceCount; /*! @method symbolSet @abstract obtaining the BCSymbolSet corresponding to the aligned BCSequences @discussion */ - (BCSymbolSet *)symbolSet; @end /*! @category BCSequenceAlignment(AlignmentAnnotation) @abstract sequence alignment annotations */ @interface BCSequenceAlignment ( AlignmentAnnotation ) /*! @method annotationForKey: @abstract obtaining the BCAnnotation for the given key @discussion */ - (BCAnnotation *)annotationForKey:(NSString *)theKey; @end /*! @category BCSequenceAlignment(PairwiseAlignment) @abstract perform pairwise sequence alignment */ @interface BCSequenceAlignment ( PairwiseAlignment ) /*! @method needlemanWunschAlignmentWithSequences:properties: @abstract perform Needleman-Wunsch pairwise sequence alignment @discussion */ + (BCSequenceAlignment *)needlemanWunschAlignmentWithSequences:(NSArray *)theSequences properties:(NSDictionary *)properties; /*! @method smithWatermanAlignmentWithSequences:properties: @abstract perform Smith-Waterman pairwise sequence alignment @discussion */ + (BCSequenceAlignment *)smithWatermanAlignmentWithSequences:(NSArray *)theSequences properties:(NSDictionary *)properties; @end biococoa-2.2.2/BCFoundation/BCAlignment/BCSequenceAlignment.m000644 000765 000024 00000004563 11223237412 024372 0ustar00scottcstaff000000 000000 // // BCAlignment.m // BioCocoa // // Created by Philipp Seibel on 09.03.05. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCSequenceAlignment.h" #import "BCStringDefinitions.h" @implementation BCSequenceAlignment - (id)initWithSequenceArray:(NSArray *)theSequenceArray { self = [super init]; if ( self ) { sequenceArray = [theSequenceArray retain]; } return self; } - (void)dealloc { [sequenceArray release]; [super dealloc]; } @end @implementation BCSequenceAlignment ( AlignmentQuerying ) - (BCSequence *)sequenceAtIndex:(unsigned int)aIndex { return (BCSequence *)[sequenceArray objectAtIndex: aIndex]; } - (BCSequenceAlignment *)alignmentInRange:(NSRange)aRange { return nil; } - (NSArray *)symbolsForColumnAtIndex:(unsigned int)aColumn { return nil; } - (unsigned int)length { return [[self sequenceAtIndex: 0] length]; } - (unsigned int)sequenceCount { return [sequenceArray count]; } - (BCSymbolSet *)symbolSet { return nil; } @end biococoa-2.2.2/BCFoundation/BCAlignment/GNUmakefile000644 000765 000024 00000003772 11226023231 022446 0ustar00scottcstaff000000 000000 # # GNUmakefile # # Written by: Scott Christley # Copyright (c) 2003-2009 The BioCocoa Project. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # include $(GNUSTEP_MAKEFILES)/common.make # The library to be compiled SUBPROJECT_NAME = BCAlignment # The Objective-C source files to be compiled BCAlignment_OBJC_FILES = \ BCPairwiseAlignment.m \ BCScoreMatrix.m \ BCSequenceAlignment.m # The header files BCAlignment_HEADER_FILES = \ BCPairwiseAlignment.h \ BCScoreMatrix.h \ BCSequenceAlignment.h BIOCOCOA_BASE_DIR = .. -include $(BIOCOCOA_BASE_DIR)/GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/subproject.make -include GNUmakefile.postamble biococoa-2.2.2/BCAppKit/2.0-cleanup/000755 000765 000024 00000000000 11455661313 017263 5ustar00scottcstaff000000 000000 biococoa-2.2.2/BCAppKit/BCAppKit.h000644 000765 000024 00000003407 11223237412 017101 0ustar00scottcstaff000000 000000 // // BCAppKit.h // BioCocoa // // Created by Koen van der Drift on Thu Feb 24 2005. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //////////////////////////////////////////////////////////////////////////// // BCAPPKIT HEADER FILES //////////////////////////////////////////////////////////////////////////// // Views #import biococoa-2.2.2/BCAppKit/BCAppKitDefines.h000644 000765 000024 00000003756 11223237412 020406 0ustar00scottcstaff000000 000000 // // BCAppKitDefines.h // BioCocoa // // Created by Koen van der Drift on Tue Mar 1 2005. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //////////////////////////////////////////////////////////////////////////// // GLOBAL DEFINES //////////////////////////////////////////////////////////////////////////// #define kLEFT_MARGIN_WIDTH 30 /*! @enum BCSequenceViewCase @abstract Provides an ordered list of possible cases displayed in a sequenceView. */ typedef enum BCSequenceViewCase { BCUppercase = 1, BCLowercase = 2, BCOthercase = 3 } BCSequenceViewCase; biococoa-2.2.2/BCAppKit/BCGEODownloadController.h000644 000765 000024 00000004005 11223237412 022052 0ustar00scottcstaff000000 000000 // // BCGEODownloadController.h // BioCocoa // // Created by Scott Christley on 10/07/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /*! @header @abstract Controller for BCGEODownload interface. */ #import @interface BCGEODownloadController : NSObject { IBOutlet NSPanel *downloadPanel; IBOutlet NSTableView *seriesTable; IBOutlet NSTextField *downloadSeries; NSMutableArray *series; } + sharedGEODownload; - (void)makeKeyAndOrderFront: (id)sender; - (IBAction)downloadSeries: (id)sender; - (IBAction)retrieveList: (id)sender; - (IBAction)showSeriesInfo: (id)sender; @end biococoa-2.2.2/BCAppKit/BCGEODownloadController.m000644 000765 000024 00000011000 11223237412 022050 0ustar00scottcstaff000000 000000 // // BCGEODownloadController.m // BioCocoa // // Created by Scott Christley on 10/07/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCGEODownloadController.h" #import "BCPreferences.h" #import "BCGeneExpressionOmnibus.h" #import "BCSeries.h" #import static BCGEODownloadController *sharedController = nil; @implementation BCGEODownloadController + sharedGEODownload { if (!sharedController) sharedController = [BCGEODownloadController new]; return sharedController; } // Default constructor - init { self = [super init]; if (self) { series = [[NSMutableArray array] retain]; [NSBundle loadNibNamed: @"BCGEODownload" owner: self]; } return self; } - (void)dealloc { if (series) [series release]; [super dealloc]; } - (void)awakeFromNib { // update the table view [seriesTable setDataSource: self]; } - (void)makeKeyAndOrderFront: (id)sender { [downloadPanel makeKeyAndOrderFront: sender]; } // GUI Interaction - (IBAction)downloadSeries: (id)sender { NSString *s = [downloadSeries stringValue]; if (!s) return; if ([s length] == 0) return; BCSeries *aSeries = [BCSeries seriesWithId: s]; if (aSeries) { NSString *msg = [NSString stringWithFormat: @"GEO Series (%@) has already been downloaded. Are you sure that you want to download again?", s]; int ret = NSRunAlertPanel(@"Download GEO Series", msg, @"Cancel", @"Download", nil); if (ret == NSAlertDefaultReturn) return; } BCGeneExpressionOmnibus *geo = [BCGeneExpressionOmnibus new]; [geo downloadGEOSeries: s]; } - (IBAction)retrieveList: (id)sender { int ret = NSRunAlertPanel(@"Retrieve List of All Series from GEO", @"Retrieving the list of all series from GEO may take a few minutes depending upon your network connection. Are you sure that you want to retrieve the list?", @"Retrieve", @"Cancel", nil); if (ret == NSAlertAlternateReturn) return; NSMutableArray *a = [BCGeneExpressionOmnibus retrieveGEOSeriesList]; if (a) { [series release]; series = [a retain]; } [seriesTable reloadData]; } - (IBAction)showSeriesInfo: (id)sender { int i = [seriesTable selectedRow]; if (i == -1) return; NSString *s = @"http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc="; s = [s stringByAppendingString: [series objectAtIndex: i]]; NSURL *anURL = [NSURL URLWithString: s]; LSOpenCFURLRef((CFURLRef)anURL, NULL); } // // Manage the table of series // - (int)numberOfRowsInTableView:(NSTableView *)aTableView { return [series count]; } - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { id theRecord; //printf("tableView:objectValueForTableColumn:row:\n"); NSParameterAssert(rowIndex >= 0 && rowIndex < [series count]); theRecord = [series objectAtIndex:rowIndex]; return theRecord; } // // NSTableView delegate methods // - (void)tableViewSelectionDidChange:(id)sender { printf("tableViewSelectionDidChange:\n"); int i = [seriesTable selectedRow]; if (i == -1) return; [downloadSeries setStringValue: [series objectAtIndex: i]]; } @end biococoa-2.2.2/BCAppKit/BCSequenceView.h000755 000765 000024 00000010462 11223237412 020316 0ustar00scottcstaff000000 000000 // // BCSequenceView.h // BioCocoa // // Created by Koen van der Drift on Sat May 01 2004. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import #import "BCAppKitDefines.h" /*! @class BCSequenceView @abstract Subclass of NSTextView to display a BCSequence @discussion This class can be used to display a BCSequence, and has several extensions * compared to a plain NSTextView. It shows a margin on the left-side of the view * where linenumbers or symbol numbers can be displayed. Also, the cursor will show the * selection of symbols. * BCSequenceView implements the following delegate methods * - (void)copy:(id)sender; * - (void)didClickInTextView: (id)sender location: (NSPoint)thePoint character: (int)c; * - (void)didDragInTextView: (id)sender location: (NSPoint)thePoint character: (int)c; * - (void)didMoveInTextView: (id)sender location: (NSPoint)thePoint character: (int)c; * - (void)didDragSelectionInTextView: (id)sender range: (NSRange)aRange; * - (NSMenu *)menuForTextView: (id)sender; * - (void)didDragFilesWithPaths: (NSArray *)paths textView: (id)sender; * - (NSMenu *)menuForTextView: (id)sender; * - (NSString *)filterInputString: (NSString *) input textView: (id)sender; */ @interface BCSequenceView : NSTextView { BOOL filter; BOOL drawNumbersInMargin; BOOL drawLineNumbers; BOOL drawOverlay; BOOL drawMarking; BCSequenceViewCase symbolCase; NSMutableDictionary *marginAttributes; NSMutableDictionary *selectionAttributes; int symbolsPerColumn; NSString *unit; NSRange markingRange; } -(void)initLineMargin:(NSRect)frame; - (BOOL)filter; - (void)setFilter:(BOOL)newFilter; - (BOOL)drawNumbersInMargin; - (void)setDrawNumbersInMargin:(BOOL)newDrawNumbersInMargin; - (BOOL)drawLineNumbers; - (void)setDrawLineNumbers:(BOOL)newDrawLineNumbers; - (BOOL)drawOverlay; - (void)setDrawOverlay:(BOOL)newDrawOverlay; - (BOOL)drawMarking; - (void)setDrawMarking:(BOOL)newDrawMarking; - (BCSequenceViewCase)symbolCase; - (void)setSymbolCase:(BCSequenceViewCase)newCase; - (NSRange)markingRange; - (void)setMarkingRange:(NSRange)newMarkingRange; - (NSString *)unit; - (void)setUnit:(NSString *)newUnit; - (int)symbolsPerColumn; - (void)setSymbolsPerColumn:(int)newNumber; -(void)updateMargin; -(void)updateLayout; -(void)drawEmptyMargin:(NSRect)aRect; -(void)drawNumbersInMargin:(NSRect)aRect; -(void)drawOneNumberInMargin:(unsigned) aNumber inRect:(NSRect)aRect; -(void)drawMarkingInTextview: (NSRect)rect; -(void)drawSelectionOverlayInTextview: (NSRect)rect; -(void)drawOverlayInTextview: (NSRect)rect; -(NSRect)marginRect; -(int)charactersPerColumn; @end @interface BCSequenceViewContainer : NSTextContainer { float columnWidth; } - (float) columnWidth; - (void) setColumnWidth:(float) width; @end @interface BCSequenceViewLayoutManager : NSLayoutManager { int symbolsPerColumn; } - (void)setSymbolsPerColumn:(int)newNumber; @end biococoa-2.2.2/BCAppKit/BCSequenceView.m000755 000765 000024 00000076505 11223237412 020335 0ustar00scottcstaff000000 000000 // // BCSequenceView.m // BioCocoa // // Created by Koen van der Drift on Sat May 01 2004. // Pimped by Alexander Griekspoor on Sat Mar 04 2006 // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // NSTextView subclass which adds: // - line numbering // - column spacing // - fancy overlays for mouse position and selections // - better information transmission on selections to the delegate // To be added in future versions: // - make columnwidth character based, instead of 90 points -> 10 chars // - calculate column width based on current font // - optimization by only redrawing dirty areas #import "BCSequenceView.h" #define COLUMN_WIDTH 10 // Available delegate methods @protocol BCSequenceViewDelegate - (void)copy:(id)sender; - (void)didClickInTextView: (id)sender location: (NSPoint)thePoint character: (int)c; - (void)didDragInTextView: (id)sender location: (NSPoint)thePoint character: (int)c; - (void)didMoveInTextView: (id)sender location: (NSPoint)thePoint character: (int)c; - (void)didDragSelectionInTextView: (id)sender range: (NSRange)aRange; - (NSMenu *)menuForTextView: (id)sender; - (void)didDragFilesWithPaths: (NSArray *)paths textView: (id)sender; - (NSMenu *)menuForTextView: (id)sender; - (NSString *)filterInputString: (NSString *) input textView: (id)sender; @end @implementation BCSequenceView - (id)initWithCoder:(NSCoder *)aDecoder; { if (self = [super initWithCoder:aDecoder]) { [self initLineMargin: [self frame]]; [self setUnit: @""]; [self setMarkingRange: NSMakeRange(NSNotFound,0)]; [self setFilter: NO]; // off by default [self setSymbolCase: BCUppercase]; [self setSymbolsPerColumn: 10]; // default } return self; } -(id)initWithFrame:(NSRect)frame { if (self = [super initWithFrame:frame]) { [self initLineMargin: frame]; [self setUnit: @""]; [self setMarkingRange: NSMakeRange(NSNotFound,0)]; [self setFilter: NO]; // off by default [self setSymbolCase: BCUppercase]; [self setSymbolsPerColumn: 10]; // default } return self; } - (void) initLineMargin:(NSRect) frame { NSSize contentSize; BCSequenceViewContainer *myContainer; BCSequenceViewLayoutManager *myLayoutManager; // create a subclass of NSTextContainer that specifies the textdraw area. // This will allow for a left margin for numbering. contentSize = [[self enclosingScrollView] contentSize]; frame = NSMakeRect(0, 0, contentSize.width, contentSize.height); myContainer = [[BCSequenceViewContainer allocWithZone:[self zone]] initWithContainerSize:NSMakeSize(frame.size.width, 100000)]; [myContainer setWidthTracksTextView:YES]; [myContainer setHeightTracksTextView:NO]; // This controls the inset of our text away from the margin. [myContainer setLineFragmentPadding: 7]; [self replaceTextContainer: myContainer]; [myContainer release]; // create a subclass of NSLayoutManager to correct for selection bug myLayoutManager = [[BCSequenceViewLayoutManager allocWithZone: [self zone]] init]; [myContainer replaceLayoutManager: myLayoutManager]; [myLayoutManager release]; // set all the parameters for the text view - it's was created from scratch, so it doesn't use // the values from the Nib file. [self setContinuousSpellCheckingEnabled: NO]; [self setRichText: NO]; [self setMinSize:frame.size]; [self setMaxSize:NSMakeSize(100000, 100000)]; [self setHorizontallyResizable:NO]; [self setVerticallyResizable:YES]; [self setAutoresizingMask:NSViewWidthSizable]; [self setAllowsUndo:YES]; [self setFont:[NSFont fontWithName: @"Courier" size: 12]]; // listen to updates from the window to force a redraw - eg when the window resizes. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidUpdate:) name:NSWindowDidUpdateNotification object:[self window]]; marginAttributes = [[NSMutableDictionary alloc] init]; [marginAttributes setObject:[NSFont boldSystemFontOfSize:8] forKey: NSFontAttributeName]; [marginAttributes setObject:[NSColor darkGrayColor] forKey: NSForegroundColorAttributeName]; selectionAttributes = [[NSMutableDictionary alloc] init]; [selectionAttributes setObject:[NSFont boldSystemFontOfSize:9] forKey: NSFontAttributeName]; [selectionAttributes setObject:[NSColor whiteColor] forKey: NSForegroundColorAttributeName]; drawNumbersInMargin = YES; drawLineNumbers = NO; drawOverlay = YES; } - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [marginAttributes release]; [selectionAttributes release]; [unit release]; [super dealloc]; } - (BOOL)filter { return filter; } - (void)setFilter:(BOOL)newFilter { filter = newFilter; } - (BOOL)drawNumbersInMargin { return drawNumbersInMargin; } - (void)setDrawNumbersInMargin:(BOOL)newDrawNumbersInMargin { drawNumbersInMargin = newDrawNumbersInMargin; } - (BOOL)drawLineNumbers { return drawLineNumbers; } - (void)setDrawLineNumbers:(BOOL)newDrawLineNumbers { drawLineNumbers = newDrawLineNumbers; } - (BOOL)drawOverlay { return drawOverlay; } - (void)setDrawOverlay:(BOOL)newDrawOverlay { drawOverlay = newDrawOverlay; } - (BOOL)drawMarking { return drawMarking; } - (void)setDrawMarking:(BOOL)newDrawMarking { drawMarking = newDrawMarking; } - (BCSequenceViewCase)symbolCase { return symbolCase; } - (void)setSymbolCase:(BCSequenceViewCase)newCase { symbolCase = newCase; } - (NSRange)markingRange { return markingRange; } - (void)setMarkingRange:(NSRange)newMarkingRange { markingRange = newMarkingRange; } - (NSString *)unit { return unit; } - (void)setUnit:(NSString *)newUnit { [newUnit retain]; [unit release]; unit = newUnit; } - (int)symbolsPerColumn { return symbolsPerColumn; } - (void)setSymbolsPerColumn:(int)newNumber { symbolsPerColumn = newNumber; // need to update the textContainer and the layoutManager as well // float characterWidth = [[self font] boundingRectForFont].size.width; float characterWidth = [[self font] maximumAdvancement].width; float columnWidth = (float) ( symbolsPerColumn * characterWidth ); columnWidth = 90; // for now hardcode this until bug is fixed symbolsPerColumn = 10; // for now hardcode this until bug is fixed [(BCSequenceViewLayoutManager *) [self layoutManager] setSymbolsPerColumn: symbolsPerColumn]; [(BCSequenceViewContainer *) [self textContainer] setColumnWidth: columnWidth]; } - (void)drawRect:(NSRect)aRect { [[self textStorage] removeAttribute: NSForegroundColorAttributeName range: NSMakeRange (0,[[self textStorage] length])]; if ( drawMarking && [self markingRange].location != NSNotFound) { [[self textStorage] addAttribute: NSForegroundColorAttributeName value:[NSColor redColor] range:[self markingRange]]; // [[self textStorage] addAttribute: NSForegroundColorAttributeName value:[NSColor darkmarkcolor] range:[self markingRange]]; } [super drawRect: aRect]; [self drawEmptyMargin: [self marginRect]]; if ( drawNumbersInMargin ) { [self drawNumbersInMargin: [self marginRect]]; } if ( drawMarking && [self markingRange].location != NSNotFound) { [self drawMarkingInTextview: aRect]; } if ( drawOverlay && [[NSGraphicsContext currentContext] isDrawingToScreen]) { [self drawSelectionOverlayInTextview: aRect]; [self drawOverlayInTextview: aRect]; } } - (void)windowDidUpdate:(NSNotification *)notification { [self updateMargin]; } - (void)updateLayout { [self updateMargin]; } -(void)updateMargin { [self setNeedsDisplayInRect:[self marginRect] avoidAdditionalLayout:NO]; } -(NSRect)marginRect { NSRect r; r = [self bounds]; r.size.width = kLEFT_MARGIN_WIDTH; return r; } -(void)drawEmptyMargin:(NSRect)aRect { /* These values control the color of our margin. Giving the rect the 'clear' background color is accomplished using the windowBackgroundColor. Change the color here to anything you like to alter margin contents. */ if([[NSGraphicsContext currentContext] isDrawingToScreen]){ [[NSColor controlHighlightColor] set]; [NSBezierPath fillRect: aRect]; } // These points should be set to the left margin width. NSPoint top = NSMakePoint(aRect.size.width, [self bounds].size.height); NSPoint bottom = NSMakePoint(aRect.size.width, 0); // This draws the dark line separating the margin from the text area. [[NSColor grayColor] set]; [NSBezierPath setDefaultLineWidth:0.75]; [NSBezierPath strokeLineFromPoint:top toPoint:bottom]; } -(void) drawNumbersInMargin:(NSRect)aRect; { UInt32 index, lineNumber; NSRange lineRange; NSRect lineRect; NSLayoutManager* layoutManager = [self layoutManager]; NSTextContainer* textContainer = [self textContainer]; // Only get the visible part of the scroller view NSRect documentVisibleRect = [[self enclosingScrollView] documentVisibleRect]; // Find the glyph range for the visible glyphs NSRange glyphRange = [layoutManager glyphRangeForBoundingRect: documentVisibleRect inTextContainer: textContainer]; // Calculate the start and end indexes for the glyphs unsigned start_index = glyphRange.location; unsigned end_index = glyphRange.location + glyphRange.length; if(![[NSGraphicsContext currentContext] isDrawingToScreen]){ start_index = 0; end_index = [layoutManager numberOfGlyphs]; } index = 0; lineNumber = 1; if([[NSGraphicsContext currentContext] isDrawingToScreen]){ // Skip all lines that are visible at the top of the text view (if any) while (index < start_index) { lineRect = [layoutManager lineFragmentRectForGlyphAtIndex:index effectiveRange:&lineRange]; index = NSMaxRange( lineRange ); ++lineNumber; } } for ( index = start_index; index < end_index; lineNumber++ ) { lineRect = [layoutManager lineFragmentRectForGlyphAtIndex:index effectiveRange:&lineRange]; //NSLog(@"Rect: %f, %f, %f, %f", lineRect.origin.x, lineRect.origin.y, lineRect.size.width, lineRect.size.height); if ( drawLineNumbers && lineRect.origin.x == kLEFT_MARGIN_WIDTH) { index = NSMaxRange( lineRange ); [self drawOneNumberInMargin:lineNumber inRect:lineRect]; } else if ( lineRect.origin.x == kLEFT_MARGIN_WIDTH) // draw character numbers { [self drawOneNumberInMargin:index+1 inRect:lineRect]; } index = NSMaxRange( lineRange ); } if ( drawLineNumbers ) { lineRect = [layoutManager extraLineFragmentRect]; [self drawOneNumberInMargin:lineNumber inRect:lineRect]; } } -(void)drawOneNumberInMargin:(unsigned) aNumber inRect:(NSRect)r { NSString *s; NSSize stringSize; s = [NSString stringWithFormat:@"%d", aNumber, nil]; stringSize = [s sizeWithAttributes:marginAttributes]; // Simple algorithm to center the line number next to the glyph. [s drawAtPoint: NSMakePoint( r.origin.x - stringSize.width - 1, r.origin.y + ((r.size.height / 2) - (stringSize.height / 2))) withAttributes:marginAttributes]; } -(void)drawMarkingInTextview: (NSRect)rect{ // don't draw when margin is drawn if(NSWidth(rect) == 30) return; NSRange range = [self markingRange]; // [[self textStorage] removeAttribute: NSForegroundColorAttributeName range: NSMakeRange (0,[[self textStorage] length])]; // [[self textStorage] addAttribute: NSForegroundColorAttributeName value:[NSColor darkmarkcolor] range:[self markingRange]]; NSString *s; NSSize stringSize; NSRect stringRect; NSBezierPath *stringPath; NSPoint p; if(range.length > 0){ NSRect r = [[self layoutManager] boundingRectForGlyphRange: NSMakeRange(range.location, 1) inTextContainer: [self textContainer]]; p = (NSPoint){r.origin.x, NSMaxY(r)}; if(range.length == 1) s = [NSString stringWithFormat:@"%d", range.location+1]; else s = [NSString stringWithFormat:@"%d-%d (%d %@)", range.location+1, range.location+range.length, range.length, [self unit]]; stringSize = [s sizeWithAttributes:selectionAttributes]; stringRect.origin.x = p.x + 5.0; stringRect.origin.y = p.y - stringSize.height - 16.0; if(stringRect.origin.y - 15.0 < rect.origin.y){ NSRect r = [[self layoutManager] boundingRectForGlyphRange: NSMakeRange(range.location + range.length - 1, 1) inTextContainer: [self textContainer]]; stringRect.origin.x = NSMaxX(r) - stringSize.width; stringRect.origin.y = NSMaxY(r) + 2.0; } if((stringRect.origin.x + stringSize.width + 10.0) > rect.origin.x + NSWidth(rect)) stringRect.origin.x -= (stringRect.origin.x + stringSize.width + 10.0) - (rect.origin.x + NSWidth(rect)); if(stringRect.origin.x < 35.0) stringRect.origin.x = 35.0; // if((stringRect.origin.y + stringSize.height + 10.0) > rect.origin.y + NSHeight(rect)) // stringRect.origin.y -= (stringRect.origin.y + stringSize.height + 10.0) - (rect.origin.y + NSHeight(rect)); stringRect.size = stringSize; stringPath = [NSBezierPath bezierPath]; [stringPath moveToPoint: (NSPoint) {stringRect.origin.x, stringRect.origin.y + 7.0}]; [stringPath lineToPoint: (NSPoint) {stringRect.origin.x + stringRect.size.width, stringRect.origin.y + 7.0}]; [stringPath setLineCapStyle: NSRoundLineCapStyle]; // [[NSColor darkmarkcolor]set]; [[NSColor redColor]set]; [stringPath setLineWidth: stringSize.height]; [stringPath stroke]; [s drawAtPoint: stringRect.origin withAttributes:selectionAttributes]; } } -(void)drawSelectionOverlayInTextview: (NSRect)rect{ // don't draw when margin is drawn if(NSWidth(rect) == kLEFT_MARGIN_WIDTH) return; NSRange range = [self selectedRange]; NSString *s; NSSize stringSize; NSRect stringRect; NSBezierPath *stringPath; NSPoint p; if(range.length > 0){ NSRect r = [[self layoutManager] boundingRectForGlyphRange: NSMakeRange(range.location, 1) inTextContainer: [self textContainer]]; p = (NSPoint){r.origin.x, NSMaxY(r)}; if(range.length == 1) s = [NSString stringWithFormat:@"%d", range.location+1]; else s = [NSString stringWithFormat:@"%d-%d (%d %@)", range.location+1, range.location+range.length, range.length, [self unit]]; stringSize = [s sizeWithAttributes:selectionAttributes]; stringRect.origin.x = p.x + 5.0; stringRect.origin.y = p.y - stringSize.height - 16.0; if(stringRect.origin.y - 15.0 < rect.origin.y){ NSRect r = [[self layoutManager] boundingRectForGlyphRange: NSMakeRange(range.location + range.length - 1, 1) inTextContainer: [self textContainer]]; stringRect.origin.x = NSMaxX(r) - stringSize.width; stringRect.origin.y = NSMaxY(r) + 2.0; } if((stringRect.origin.x + stringSize.width + 10.0) > rect.origin.x + NSWidth(rect)) stringRect.origin.x -= (stringRect.origin.x + stringSize.width + 10.0) - (rect.origin.x + NSWidth(rect)); if(stringRect.origin.x < 35.0) stringRect.origin.x = 35.0; // if((stringRect.origin.y + stringSize.height + 10.0) > rect.origin.y + NSHeight(rect)) // stringRect.origin.y -= (stringRect.origin.y + stringSize.height + 10.0) - (rect.origin.y + NSHeight(rect)); stringRect.size = stringSize; stringPath = [NSBezierPath bezierPath]; [stringPath moveToPoint: (NSPoint) {stringRect.origin.x, stringRect.origin.y + 7.0}]; [stringPath lineToPoint: (NSPoint) {stringRect.origin.x + stringRect.size.width, stringRect.origin.y + 7.0}]; [stringPath setLineCapStyle: NSRoundLineCapStyle]; [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.6]set]; [stringPath setLineWidth: stringSize.height]; [stringPath stroke]; [s drawAtPoint: stringRect.origin withAttributes:selectionAttributes]; } } -(void)drawOverlayInTextview: (NSRect)rect{ NSPoint cursor = [self convertPoint: [[self window] mouseLocationOutsideOfEventStream] fromView: nil]; if(cursor.x < 30.0) return; if(!NSPointInRect(cursor, rect)) return; NSTextStorage* textStorage = [self textStorage]; NSRange selectedRange = [self selectedRange]; NSString *s; NSSize stringSize; NSRect stringRect; NSBezierPath *stringPath; if(selectedRange.length > 0){ return; } else { CGFloat partial = 1.0; int c = (int) [[self layoutManager] glyphIndexForPoint: cursor inTextContainer: [self textContainer] fractionOfDistanceThroughGlyph: &partial]; if(c > 0 && c < [textStorage length] - 1) s = [NSString stringWithFormat:@"%d", c+1]; else return; } stringSize = [s sizeWithAttributes:selectionAttributes]; stringRect.origin.x = cursor.x + 8.0; stringRect.origin.y = cursor.y + stringSize.height + 2.0; if((stringRect.origin.x + stringSize.width + 10.0) > rect.origin.x + NSWidth(rect)) stringRect.origin.x -= (stringRect.origin.x + stringSize.width + 10.0) - (rect.origin.x + NSWidth(rect)); if((stringRect.origin.y + stringSize.height + 10.0) > rect.origin.y + NSHeight(rect)) stringRect.origin.y -= (stringRect.origin.y + stringSize.height + 10.0) - (rect.origin.y + NSHeight(rect)); stringRect.size = stringSize; stringPath = [NSBezierPath bezierPath]; [stringPath moveToPoint: (NSPoint) {stringRect.origin.x, stringRect.origin.y + 7.0}]; [stringPath lineToPoint: (NSPoint) {stringRect.origin.x + stringRect.size.width, stringRect.origin.y + 7.0}]; [stringPath setLineCapStyle: NSRoundLineCapStyle]; [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.6]set]; [stringPath setLineWidth: stringSize.height]; [stringPath stroke]; [s drawAtPoint: stringRect.origin withAttributes:selectionAttributes]; } // Allows customization of contextual menu by delegate -(NSMenu*)menuForEvent:(NSEvent*) evt { id delegate = [self delegate]; if ([delegate respondsToSelector:@selector(menuForTextView:)]) return [delegate menuForTextView: self]; return nil; } // Mouse methods that inform delegate - (void)mouseDown:(NSEvent *)theEvent{ id delegate = [self delegate]; CGFloat partial = 0.5; NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil]; if ([delegate respondsToSelector:@selector(didClickInTextView: location: character:)]){ int c = (int) [[self layoutManager] glyphIndexForPoint: p inTextContainer: [self textContainer] fractionOfDistanceThroughGlyph: &partial]; [delegate didClickInTextView: self location: p character: c]; } // redraw to sync overlays [self setNeedsDisplay: YES]; [super mouseDown: theEvent]; } - (void)mouseMoved:(NSEvent *)theEvent{ CGFloat partial = 1.0; NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil]; int c = (int) [[self layoutManager] glyphIndexForPoint: p inTextContainer: [self textContainer] fractionOfDistanceThroughGlyph: &partial]; id delegate = [self delegate]; if ([delegate respondsToSelector:@selector(didMoveInTextView: location: character:)]){ [delegate didMoveInTextView: self location: p character: c]; } // redraw to sync overlays [self setNeedsDisplay: YES]; [super mouseMoved: theEvent]; } - (void)mouseEntered:(NSEvent *)theEvent{ // redraw to sync overlays [self setNeedsDisplay: YES]; [super mouseEntered: theEvent]; } - (void)mouseExited:(NSEvent *)theEvent{ // redraw to sync overlays [self setNeedsDisplay: YES]; [super mouseExited: theEvent]; } - (NSRange)selectionRangeForProposedRange:(NSRange)proposedCharRange granularity:(NSSelectionGranularity)granularity{ NSRange newCharRange; if(granularity == NSSelectByWord){ newCharRange.location = (proposedCharRange.location / 10) * 10; newCharRange.length = ((proposedCharRange.location + proposedCharRange.length) / 10 + 1) * 10 - newCharRange.location; // sanity checks if(newCharRange.location < 0){ newCharRange.length -= -newCharRange.location; newCharRange.location = 0; } if(newCharRange.location + newCharRange.length > [[self textStorage]length]){ newCharRange.length -= (newCharRange.location + newCharRange.length) - [[self textStorage]length]; } } else { newCharRange = [super selectionRangeForProposedRange:proposedCharRange granularity:granularity]; } //NSLog(@"%d -> old: %@ new: %@", granularity, NSStringFromRange(proposedCharRange), NSStringFromRange(newCharRange)); // DRAGGING SELECTION id delegate = [self delegate]; if ([delegate respondsToSelector:@selector(didDragSelectionInTextView:range:)]){ [delegate didDragSelectionInTextView: self range: newCharRange]; } // MAKE SURE THAT SELECTION IS REDRAWN DURING DRAG [self setNeedsDisplay: YES]; return newCharRange; } - (void)setSelectedRange:(NSRange)aRange{ // MAKE SURE THAT SELECTION IS REDRAWN DURING DRAG [self setNeedsDisplay: YES]; [super setSelectedRange: aRange]; } -(int)charactersPerColumn { int result = 0; float columnWidth = [(BCSequenceViewContainer *)[self textContainer] columnWidth]; float characterWidth = [[self font] boundingRectForFont].size.width; result = (int) ( columnWidth / characterWidth ); return result; } // DRAG FILE - (BOOL)performDragOperation:(id )sender { NSPasteboard *pboard = [sender draggingPasteboard]; if ( [[pboard types] containsObject: NSFilenamesPboardType] ) { id delegate = [self delegate]; if ([delegate respondsToSelector:@selector(didDragFilesWithPaths:textView:)]){ [delegate didDragFilesWithPaths: [pboard propertyListForType:NSFilenamesPboardType] textView: self]; return YES; } else return NO; } else return [super performDragOperation:sender]; } - (void)insertText:(id)aString{ NSString *filteredString; // FILTERING OF VALID SYMBOLS if([self filter]) { id delegate = [self delegate]; if ([delegate respondsToSelector:@selector(filterInputString: textView:)]){ filteredString = [delegate filterInputString: aString textView: self]; } } else filteredString = aString; // also check if we need to update the marking if(markingRange.length > 0){ NSRange editedRange = [self rangeForUserTextChange]; //NSLog(@"Edit: %@ Marking: %@", NSStringFromRange(editedRange), NSStringFromRange(markingRange)); // begins after if(editedRange.location >= NSMaxRange(markingRange)){ //NSLog(@"begins after"); } // begins before else if(editedRange.location < markingRange.location){ // ends before if(NSMaxRange(editedRange) <= markingRange.location){ //NSLog(@"begins before, ends before"); markingRange.location -= editedRange.length - [filteredString length]; } // ends in else if(NSMaxRange(editedRange) < NSMaxRange(markingRange)){ //NSLog(@"begins before, ends in"); markingRange.length -= editedRange.location + editedRange.length - markingRange.location; markingRange.location = editedRange.location + [filteredString length]; } // ends after else { //NSLog(@"begins before, ends after"); markingRange = NSMakeRange(NSNotFound,0); } // editedrange contained in } else { // ends in if(NSMaxRange(editedRange) < NSMaxRange(markingRange)){ //NSLog(@"begins in, ends in"); markingRange.length -= editedRange.length - [filteredString length]; } // ends after else { //NSLog(@"begins in, ends after"); markingRange.length -= NSMaxRange(markingRange) - editedRange.location; } } } // finally insert the filteredstring switch ([self symbolCase]) { case BCUppercase: [super insertText: [filteredString uppercaseString]]; break; case BCLowercase: [super insertText: [filteredString lowercaseString]]; break; case BCOthercase: [super insertText: filteredString]; break; } } - (void)setString:(NSString *)aString { if (aString == nil) return; NSString *filteredString; if([self filter]) { id delegate = [self delegate]; if ([delegate respondsToSelector:@selector(filterInputString: textView:)]){ filteredString = [delegate filterInputString: aString textView: self]; } } else filteredString = aString; // also check if we need to update the marking if(markingRange.length > 0) markingRange = NSMakeRange(NSNotFound,0); // finally insert the filteredstring switch ([self symbolCase]) { case BCUppercase: [super insertText: [filteredString uppercaseString]]; break; case BCLowercase: [super insertText: [filteredString lowercaseString]]; break; case BCOthercase: [super insertText: filteredString]; break; } } - (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard type:(NSString *)type{ // the docs say to call this first, so we do ;-) [pboard types]; // try to read a string, if not succesful bummer, otherwise insert it NSString *aString = [pboard stringForType: type]; if(aString){ [self insertText: aString]; return YES; } else return NO; } - (void)delete:(id)sender{ [self deleteBackward: (id)sender]; } - (void)deleteBackward:(id)sender{ // also check if we need to update the marking if(markingRange.length > 0){ NSRange editedRange = [self rangeForUserTextChange]; // NSLog(@"Edit: %@ Marking: %@", NSStringFromRange(editedRange), NSStringFromRange(markingRange)); // begins after if(editedRange.location > NSMaxRange(markingRange)){ //NSLog(@"begins after"); } // begins before else if(editedRange.location < markingRange.location){ // ends before if(NSMaxRange(editedRange) <= markingRange.location){ //NSLog(@"begins before, ends before"); if(editedRange.length == 0) markingRange.location --; else markingRange.location -= editedRange.length; } // ends in else if(NSMaxRange(editedRange) < NSMaxRange(markingRange)){ //NSLog(@"begins before, ends in"); markingRange.length -= editedRange.location + editedRange.length - markingRange.location; markingRange.location = editedRange.location; } // ends after else { //NSLog(@"begins before, ends after"); markingRange = NSMakeRange(NSNotFound,0); } // editedrange contained in } else { // ends in if(NSMaxRange(editedRange) < NSMaxRange(markingRange)){ //NSLog(@"begins in, ends in"); if(editedRange.length == 0) markingRange.length --; else markingRange.length -= editedRange.length; } // ends after else { //NSLog(@"begins in, ends after"); if(editedRange.length == 0) markingRange.length --; else markingRange.length -= NSMaxRange(markingRange) - editedRange.location; } } } [super deleteBackward: sender]; } - (void)deleteForward:(id)sender{ // also check if we need to update the marking if(markingRange.length > 0){ NSRange editedRange = [self rangeForUserTextChange]; // NSLog(@"Edit: %@ Marking: %@", NSStringFromRange(editedRange), NSStringFromRange(markingRange)); // begins after if(editedRange.location > NSMaxRange(markingRange)){ //NSLog(@"begins after"); } // begins before else if(editedRange.location < markingRange.location){ // ends before if(NSMaxRange(editedRange) <= markingRange.location){ //NSLog(@"begins before, ends before"); if(editedRange.length == 0) markingRange.location --; else markingRange.location -= editedRange.length; } // ends in else if(NSMaxRange(editedRange) < NSMaxRange(markingRange)){ //NSLog(@"begins before, ends in"); markingRange.length -= editedRange.location + editedRange.length - markingRange.location; markingRange.location = editedRange.location; } // ends after else { //NSLog(@"begins before, ends after"); markingRange = NSMakeRange(NSNotFound,0); } // editedrange contained in } else { // ends in if(NSMaxRange(editedRange) < NSMaxRange(markingRange)){ //NSLog(@"begins in, ends in"); if(editedRange.length == 0) markingRange.length --; else markingRange.length -= editedRange.length; } // ends after else { //NSLog(@"begins in, ends after"); if(editedRange.length == 0) markingRange.length --; else markingRange.length -= NSMaxRange(markingRange) - editedRange.location; } } } [super deleteForward: sender]; } @end @implementation BCSequenceViewContainer - (BOOL) isSimpleRectangularTextContainer { return NO; } - (void) setColumnWidth:(float) width { columnWidth = width; [[self layoutManager] textContainerChangedGeometry:self]; } - (float) columnWidth { return columnWidth; } - (NSRect)lineFragmentRectForProposedRect:(NSRect)proposedRect sweepDirection:(NSLineSweepDirection)sweepDirection movementDirection:(NSLineMovementDirection)movementDirection remainingRect:(NSRect *)remainingRect { if(proposedRect.origin.x <= 0.0) proposedRect.origin.x = kLEFT_MARGIN_WIDTH; proposedRect.size.width = columnWidth; if (proposedRect.origin.x + 2 * columnWidth - 20.0 >= [self containerSize].width) *remainingRect = NSZeroRect; else { remainingRect->origin.x = proposedRect.origin.x + columnWidth - 10.0; remainingRect->origin.y = proposedRect.origin.y; remainingRect->size.width = [self containerSize].width - proposedRect.origin.x - columnWidth; remainingRect->size.height = proposedRect.size.height; } return proposedRect; } @end @implementation BCSequenceViewLayoutManager - (void)setSymbolsPerColumn:(int)newNumber { symbolsPerColumn = newNumber; } - (unsigned)glyphIndexForPoint:(NSPoint)aPoint inTextContainer:(NSTextContainer *)aTextContainer fractionOfDistanceThroughGlyph:(CGFloat *)partialFraction{ unsigned idx = [super glyphIndexForPoint: aPoint inTextContainer: aTextContainer fractionOfDistanceThroughGlyph: partialFraction]; // because of a bug in this method we check by hand if wrong value is given if(idx == symbolsPerColumn && !NSPointInRect(aPoint, [self boundingRectForGlyphRange: NSMakeRange(symbolsPerColumn,1) inTextContainer: aTextContainer])){ int i; for (i=0; i #import @interface BCSeriesTableController : NSObject { IBOutlet NSWindow *datasetWindow; IBOutlet NSTableView *datasetTable; IBOutlet NSPopUpButton *datasetColumns; IBOutlet NSPanel *inspectorPanel; //IBOutlet NSTextView *inspectorText; IBOutlet WebView *inspectorText; NSMutableDictionary *series; NSMutableArray *dataset; NSMutableArray *datasetSearch; } // Default constructor - initWithSeries: (NSDictionary *)aSet; - (void)makeKeyAndOrderFront: (id)sender; // Manage the user interface - (IBAction)loadSeries: (id)sender; - (IBAction)showPlatforms: (id)sender; - (IBAction)showSamples: (id)sender; - (IBAction)showProbes: (id)sender; - (IBAction)showGEODownload: (id)sender; - (IBAction)modifyTableColumn: (id)sender; - (IBAction)searchSeries: (id)sender; @end biococoa-2.2.2/BCAppKit/BCSeriesTableController.m000644 000765 000024 00000024277 11223237412 022174 0ustar00scottcstaff000000 000000 // // BCSeriesTableController.m // BioCocoa // // Created by Scott Christley on 10/07/08. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "BCSeriesTableController.h" #import "BCSeries.h" #import "BCGEODownloadController.h" #import @implementation BCSeriesTableController // Use - init { return [self initWithSeries: [BCSeries getAllSeries]]; } // Default constructor - initWithSeries: (NSDictionary *)aSet { self = [super init]; if (self) { series = [[NSMutableDictionary dictionaryWithDictionary: aSet] retain]; dataset = [[NSMutableArray arrayWithArray: [series allKeys]] retain]; printf("%s\n", [[dataset description] UTF8String]); datasetSearch = nil; [NSBundle loadNibNamed: @"BCSeriesTable" owner: self]; } return self; } - (void)dealloc { if (series) [series release]; [super dealloc]; } - (void)awakeFromNib { [datasetTable registerForDraggedTypes: [NSArray arrayWithObject:BCSeriesDataType] ]; // update the table view datasetSearch = nil; [datasetTable setDataSource: self]; } - (void)makeKeyAndOrderFront: (id)sender { [datasetWindow makeKeyAndOrderFront: sender]; } // // Manage the user interface // - (void)updateColumnButton { NSSet *keys = [BCSeries keysForSeries: [series allValues] withInternalKeys: NO]; NSArray *a = [keys allObjects]; NSMutableArray *addList = [NSMutableArray arrayWithArray: a]; NSMutableArray *delList = [NSMutableArray arrayWithArray: a]; NSArray *tc = [datasetTable tableColumns]; int i; for (i = 0; i < [tc count]; ++i) { NSTableColumn *c = [tc objectAtIndex: i]; [addList removeObject: [c identifier]]; } [delList removeObjectsInArray: addList]; [datasetColumns removeAllItems]; [datasetColumns addItemWithTitle: @"Modify Columns"]; for (i = 0; i < [addList count]; ++i) { NSString *s = [NSString stringWithFormat: @"Add - %@", [addList objectAtIndex: i]]; [datasetColumns addItemWithTitle: s]; } for (i = 0; i < [delList count]; ++i) { NSString *s = [NSString stringWithFormat: @"Remove - %@", [delList objectAtIndex: i]]; [datasetColumns addItemWithTitle: s]; } [datasetColumns selectItemAtIndex: 0]; } - (IBAction)loadSeries: (id)sender { int i = [datasetTable selectedRow]; if (i == -1) return; else { id theRecord; if (datasetSearch) theRecord = [datasetSearch objectAtIndex: i]; else theRecord = [dataset objectAtIndex: i]; theRecord = [series objectForKey: theRecord]; [theRecord loadIfNecessary]; [datasetTable reloadData]; [self updateColumnButton]; } } - (IBAction)showPlatforms: (id)sender { int i = [datasetTable numberOfSelectedRows]; if (i == 0) return; BOOL requiresLoad = NO; if (i == 1) { id theRecord; if (datasetSearch) theRecord = [datasetSearch objectAtIndex: i]; else theRecord = [dataset objectAtIndex: i]; theRecord = [series objectForKey: theRecord]; if (![theRecord isLoaded]) requiresLoad = YES; } else { } } - (IBAction)showSamples: (id)sender { } - (IBAction)showProbes: (id)sender { } - (IBAction)showGEODownload: (id)sender { id geoDownload = [BCGEODownloadController sharedGEODownload]; [geoDownload makeKeyAndOrderFront: sender]; } - (IBAction)modifyTableColumn: (id)sender { NSString *s = [sender titleOfSelectedItem]; if ([s isEqualToString: @"Modify Columns"]) return; NSRange r1, r2; r1 = [s rangeOfString: @"Add - "]; if (r1.location != NSNotFound) { r2.location = r1.length; r2.length = [s length] - r2.location; NSString *anId = [s substringWithRange: r2]; NSTableColumn *tc = [[[NSTableColumn alloc] initWithIdentifier: anId] autorelease]; [tc setEditable: NO]; [[tc headerCell] setStringValue: anId]; [datasetTable addTableColumn: tc]; [self updateColumnButton]; return; } r1 = [s rangeOfString: @"Remove - "]; if (r1.location != NSNotFound) { r2.location = r1.length; r2.length = [s length] - r2.location; NSString *anId = [s substringWithRange: r2]; [datasetTable removeTableColumn: [datasetTable tableColumnWithIdentifier: anId]]; [self updateColumnButton]; return; } } // // Search // - (IBAction)searchSeries: (id)sender { NSString *s = [sender stringValue]; //printf("search %d %s\n", [s length], [s UTF8String]); if (datasetSearch) [datasetSearch release]; datasetSearch = nil; if ([s length] == 0) { [datasetTable reloadData]; return; } int i, j; NSArray *tc = [datasetTable tableColumns]; NSMutableArray *searchFields = [NSMutableArray new]; for (i = 0; i < [tc count]; ++i) { NSTableColumn *c = [tc objectAtIndex: i]; [searchFields addObject: [c identifier]]; } datasetSearch = [NSMutableArray new]; for (i = 0; i < [dataset count]; ++i) { id theRecordId = [dataset objectAtIndex:i]; id theRecord = [series objectForKey: theRecordId]; for (j = 0; j < [searchFields count]; ++j) { NSString *anId = [searchFields objectAtIndex: j]; NSRange r = [[theRecord valueForKey: anId] rangeOfString: s options: NSCaseInsensitiveSearch]; if (r.location != NSNotFound) { [datasetSearch addObject: theRecordId]; break; } } } [datasetTable reloadData]; } // // Inspector panel // - (void)updateInspectorText { int i = [datasetTable selectedRow]; if (i == -1) { //[inspectorText setString: @""]; } else { id theRecord; if (datasetSearch) theRecord = [datasetSearch objectAtIndex:i]; else theRecord = [dataset objectAtIndex:i]; theRecord = [series objectForKey: theRecord]; //[inspectorText setString: [theRecord seriesDescription]]; [[inspectorText mainFrame] loadHTMLString: [theRecord seriesHTMLDescription] baseURL: nil]; } } - (void)showInspector: (id)sender { [self updateInspectorText]; [inspectorPanel makeKeyAndOrderFront: sender]; } // // Manage the table of series // - (int)numberOfRowsInTableView:(NSTableView *)aTableView { if (datasetSearch) return [datasetSearch count]; else return [dataset count]; } - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { id theRecord, theValue; printf("tableView:objectValueForTableColumn:row:\n"); if (datasetSearch) { NSParameterAssert(rowIndex >= 0 && rowIndex < [datasetSearch count]); theRecord = [datasetSearch objectAtIndex:rowIndex]; theRecord = [series objectForKey: theRecord]; theValue = [theRecord valueForKey:[aTableColumn identifier]]; return theValue; } else { NSParameterAssert(rowIndex >= 0 && rowIndex < [dataset count]); theRecord = [dataset objectAtIndex:rowIndex]; theRecord = [series objectForKey: theRecord]; theValue = [theRecord valueForKey:[aTableColumn identifier]]; return theValue; } } - (void)tableView:(NSTableView *)aTableView setObjectValue:anObject forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { #if 0 id theRecord; printf("tableView:setObjectValue:forTableColumn:row:\n"); if (datasetSearch) { NSParameterAssert(rowIndex >= 0 && rowIndex < [datasetSearch count]); theRecord = [datasetSearch objectAtIndex:rowIndex]; [theRecord setObject:anObject forKey:[aTableColumn identifier]]; } else { NSParameterAssert(rowIndex >= 0 && rowIndex < [dataset count]); theRecord = [dataset objectAtIndex:rowIndex]; [theRecord setObject:anObject forKey:[aTableColumn identifier]]; } #endif return; } // // NSTableView delegate methods // - (void)tableViewSelectionDidChange:(id)sender { printf("tableViewSelectionDidChange:\n"); [self updateColumnButton]; [self updateInspectorText]; } // // Drag/Drop support // - (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard*)pboard { // Copy the series id to the pasteboard. unsigned int i = [rowIndexes firstIndex]; id theRecord; if (datasetSearch) theRecord = [datasetSearch objectAtIndex:i]; else theRecord = [dataset objectAtIndex:i]; theRecord = [series objectForKey: theRecord]; NSString *s = [theRecord getId]; [pboard declareTypes:[NSArray arrayWithObject:BCSeriesDataType] owner:self]; [pboard setString:s forType:BCSeriesDataType]; return YES; } // // // - (void)webView:(WebView *)sender decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id)listener { //printf("webView:decidePolicyForNavigationAction:request:frame:\n"); NSURL *anURL = [request URL]; NSString *aString = [anURL absoluteString]; //printf("%s\n", [aString UTF8String]); if ([aString isEqualToString: @"about:blank"]) { [listener use]; } else { NSRange r = [aString rangeOfString: @"applewebdata:"]; if (r.location != NSNotFound) { [listener use]; } else { [listener ignore]; LSOpenCFURLRef((CFURLRef)anURL, NULL); } } } @end biococoa-2.2.2/BCAppKit/EntrezController.h000644 000765 000024 00000014025 11223237412 021015 0ustar00scottcstaff000000 000000 // // EntrezController.h // BioCocoa // // Created by Alexander Griekspoor // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import #import "EntrezResult.h" #import #import @interface EntrezController : NSWindowController{ //=========================================================================== // Outlets //=========================================================================== IBOutlet NSSearchField *searchField; IBOutlet NSMenu *searchMenu; IBOutlet NSButton *fetchButton; IBOutlet NSButton *cancelButton; IBOutlet NSTableView *tv; IBOutlet NSTextView *preview; IBOutlet NSProgressIndicator *progress; IBOutlet NSTextField *progressTextField; //=========================================================================== // Variables //=========================================================================== NSUserDefaults *prefs; NSMutableArray *searchResults; SXMLTree *hits; NSURLConnection *connection; NSMutableData *receivedData; NSURLResponse *response; long long bytesReceived; BOOL searchInProgress; BOOL summaryFetchInProgress; BOOL fetchInProgress; int searchcount; int fetchedResults; NSString *webenv; NSString *querykey; id delegate; } //=========================================================================== #pragma mark - #pragma mark • Init & Dealloc //=========================================================================== - (void)awakeFromNib; - (void)dealloc; - (void)setDelegate:(id)newDelegate; - (id)delegate; //=========================================================================== #pragma mark - #pragma mark • ACTIONS //=========================================================================== - (IBAction)searchForQuery:(id)sender; - (IBAction)fetch:(id)sender; - (IBAction)cancel:(id)sender; - (IBAction)showPreview:(id)sender; //=========================================================================== #pragma mark - #pragma mark • TABLEVIEW METHODS //=========================================================================== - (int)numberOfRowsInTableView:(NSTableView *)theTableView; - (id)tableView:(NSTableView *)theTableView objectValueForTableColumn:(NSTableColumn *)theColumn row:(int)rowIndex; - (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex; - (void)tableViewSelectionDidChange:(NSNotification *)aNotification; - (void)tableView:(NSTableView*)tv didClickTableColumn:(NSTableColumn *)tableColumn; - (void)clearIndicatorImages; // ================================================================ #pragma mark --- DOWNLOAD METHODS // ================================================================ - (void)retrieveSearchResultsForQuery: (NSString *)q; - (BOOL)parseSearchResults: (NSData *)results; - (void)retrieveSummaries; - (BOOL)parseSummaries: (NSData *)results; - (void)fetchResult: (EntrezResult *)result; - (BOOL)parseFetch: (NSData *)results; - (void)cleanupDownload; - (void)reportDownloadFailureWithError: (NSString *)errorstring; - (void) NCBIconnectionError: (id) anError; // ================================================================ #pragma mark --- DOWNLOAD ACCESSORS // ================================================================ - (NSURLResponse *)response; - (void)setResponse:(NSURLResponse *)newResponse; - (NSString *)webenv; - (void)setWebenv:(NSString *)newWebenv; - (NSString *)querykey; - (void)setQuerykey:(NSString *)newQuerykey; // ================================================================ #pragma mark --- CONNECTION DELEGATES // ================================================================ - (void)connection: (NSURLConnection *)theConnection didReceiveResponse: (NSURLResponse *)theresponse; - (void)connection: (NSURLConnection *)connection didReceiveData: (NSData *)data; - (void)connection: (NSURLConnection *)connection didFailWithError: (NSError *)error; - (void)connectionDidFinishLoading:(NSURLConnection *)connection; //=========================================================================== #pragma mark - #pragma mark --- DELEGATES //=========================================================================== - (BOOL)validateMenuItem:(NSMenuItem *)anItem; //=========================================================================== #pragma mark - #pragma mark --- GENERAL METHODS //=========================================================================== - (BOOL)parseOutput: (NSData *)output; - (BOOL) _canConnect; @end biococoa-2.2.2/BCAppKit/EntrezController.m000644 000765 000024 00000073060 11223237412 021026 0ustar00scottcstaff000000 000000 // // EntrezController.m // BioCocoa // // Created by Alexander Griekspoor // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* This (shared) window controller is all you need to search and fetch entrez. In comes with its own nib file and generates EntrezResult objects which are displayed in a tableview. We make use of NSConnection and NSURLDownload for asynchronous fetching of results and sequences. The flow of the program is in short: - retrieve results for query, generates an xml file with IDs (using NCBI's eSearch eUtil). - parse this file and retrieve summaries for each ID (using NCBI's eSummary's eUtil). - parse xml file with summaries, create for each one a EntrezResult object and display those in the Tableview. - if the user selects one, it is fetched (using NCBI's eFetch eUtil). - the response is parsed and forwarded to the delegate, this controller is cleaned-up afterwards. */ #import "EntrezController.h" // The delegate only has to implement one method to receive the fetched sequence: @protocol EntrezControllerDelegate - (void)insertFetchedSequence: (NSString *)seq withName: (NSString *)title; @end @implementation EntrezController //=========================================================================== #pragma mark - #pragma mark Init & Dealloc //=========================================================================== - (EntrezController *)init { self = [super initWithWindowNibName: @"Entrez"]; prefs = [NSUserDefaults standardUserDefaults]; searchResults = [[NSMutableArray array] retain]; return self; } - (void)awakeFromNib{ //TEXTVIEW SETUP [preview setFont: [NSFont fontWithName: @"Courier" size: 11.0]]; //SEARCHFIELD SETUP [searchField setRecentsAutosaveName: @"RecentEntrezSearches"]; [searchField setTarget:self]; [searchField setDelegate:self]; [self showPreview: self]; // PROGRESS SETUP [progressTextField setStringValue: @""]; [self cleanupDownload]; // STATUS searchInProgress = NO; summaryFetchInProgress = NO; fetchInProgress = NO; fetchedResults = 0; // DOWNLOAD SETUP receivedData = nil; } - (void)dealloc{ if(receivedData != nil){ [receivedData release]; receivedData = nil; } if ( connection != nil ) { [connection release]; connection = nil; } [webenv release]; [querykey release]; [searchResults release]; [super dealloc]; } -(void)setDelegate:(id) newDelegate { delegate = newDelegate; } -(id)delegate { return delegate; } //=========================================================================== #pragma mark - #pragma mark ACTIONS //=========================================================================== - (IBAction)searchForQuery:(id)sender{ if([[sender stringValue]isEqualToString:@""]){ [self cleanupDownload]; [progressTextField setStringValue: @""]; fetchedResults = 0; [searchResults removeAllObjects]; [tv reloadData]; } else if(searchInProgress || summaryFetchInProgress || fetchInProgress){ // cancel [self cleanupDownload]; // go again [self retrieveSearchResultsForQuery: [sender stringValue]]; } else { [self retrieveSearchResultsForQuery: [sender stringValue]]; } } - (IBAction)fetch:(id)sender{ int row = [tv selectedRow]; if (row == -1) { NSBeep(); } else { [self fetchResult: [searchResults objectAtIndex: row]]; } } - (IBAction)cancel:(id)sender{ [self cleanupDownload]; fetchedResults = 0; [progressTextField setStringValue: @""]; [NSApp endSheet: [self window] returnCode: 1]; [[self window] orderOut: self]; } - (IBAction)showPreview:(id)sender{ NSAttributedString* newStorage; NSMutableDictionary* attDict = [NSMutableDictionary dictionary]; int row = [tv selectedRow]; NSMutableString *resultsstring = [NSMutableString stringWithCapacity: 1000]; if (row == -1) { [resultsstring appendString: @"\nNo Record Selected"]; NSMutableParagraphStyle *modifiedStyle = [[NSMutableParagraphStyle alloc] init]; [modifiedStyle setAlignment: NSCenterTextAlignment]; [attDict setObject: modifiedStyle forKey: NSParagraphStyleAttributeName]; [attDict setObject: [NSFont systemFontOfSize: 16.0] forKey: NSFontAttributeName]; [attDict setObject: [NSColor lightGrayColor] forKey: NSForegroundColorAttributeName]; [modifiedStyle release]; newStorage = [[NSAttributedString alloc] initWithString: resultsstring attributes:attDict]; [fetchButton setEnabled: NO]; } else { [resultsstring appendString: [NSString stringWithFormat: @"%@ %@", [[searchResults objectAtIndex: row] extra], [[searchResults objectAtIndex: row] description]]]; [attDict setObject: [NSFont fontWithName: @"Courier" size: 12] forKey: NSFontAttributeName]; [attDict setObject: [NSColor blackColor] forKey: NSForegroundColorAttributeName]; [attDict setObject: [NSColor whiteColor] forKey: NSBackgroundColorAttributeName]; newStorage = [[NSAttributedString alloc] initWithString: resultsstring attributes:attDict]; [fetchButton setEnabled: YES]; } [[preview textStorage] setAttributedString: newStorage]; [newStorage release]; } //=========================================================================== #pragma mark - #pragma mark TABLEVIEW METHODS //=========================================================================== - (int)numberOfRowsInTableView:(NSTableView *)theTableView{ return [searchResults count]; } - (id)tableView:(NSTableView *)theTableView objectValueForTableColumn:(NSTableColumn *)theColumn row:(int)rowIndex{ if([[theColumn identifier]isEqualToString: @"accession"]){ return [[searchResults objectAtIndex: rowIndex] accession]; } else if([[theColumn identifier]isEqualToString: @"description"]){ return [[searchResults objectAtIndex: rowIndex] description]; } else if([[theColumn identifier]isEqualToString: @"species"]){ return [[searchResults objectAtIndex: rowIndex] species]; } return nil; } - (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex{ // TO COMPENSATE FOR ADJUSTED iTABLEVIEW if([(NSCell *)aCell type] == NSTextCellType){ [aCell setTextColor: [NSColor blackColor]]; } } - (void)tableViewSelectionDidChange:(NSNotification *)aNotification{ [self showPreview: self]; } - (void)tableView:(NSTableView*)tv didClickTableColumn:(NSTableColumn *)tableColumn{ } - (void)clearIndicatorImages{ } // ================================================================ #pragma mark - #pragma mark DOWNLOAD METHODS // ================================================================ - (void)retrieveSearchResultsForQuery: (NSString *)q{ //NSString *field = nil; if([[searchField stringValue]isEqualToString: @""]){ NSBeep(); return; } // PREPARE [progress startAnimation: self]; [progressTextField setStringValue: @"Contacting NCBI..."]; searchInProgress = YES; /* // PREVIOUS SEARCH? -> support for Search more using webenv, not implemented here... if(fetchedResults > 0 && webenv != nil){ } else { */ //NSLog(@"%@", q); NSMutableString *str = [NSMutableString stringWithString: [NSString stringWithFormat: @"http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=nucleotide&retmode=xml&usehistory=y&retmax=150&tool=EnzymeX&retstart=%d&term=", fetchedResults]]; NSMutableString *query = [NSMutableString stringWithString: q]; // Replace spaces by + [query replaceOccurrencesOfString: @" " withString: @"+" options: NSCaseInsensitiveSearch range: NSMakeRange(0, [query length])]; [str appendString: query]; /* // Add field, unused here, but would allow searches in specific categories only // Contains [] already? -> ALL, otherwise check title of menu if([query rangeOfString: @"["].location == NSNotFound){ id eObject; NSEnumerator *e = [[searchMenu itemArray] objectEnumerator]; while (eObject = [e nextObject]){ if([eObject state] == NSOnState){ field = [eObject title]; break; } } if([field isEqualToString: @"All"]) field = nil; else if([field isEqualToString: @"Accession"]) field = @"[ACCN]"; else if([field isEqualToString: @"Author(s)"]) field = @"[AUTH]"; else if([field isEqualToString: @"Property"]) field = @"[PROP]"; else if([field isEqualToString: @"Definition"]) field = @"[TITL]"; else if([field isEqualToString: @"Feature"]) field = @"[FKEY]"; else if([field isEqualToString: @"Gene"]) field = @"[GENE]"; else if([field isEqualToString: @"Organism"]) field = @"[ORGN]"; else if([field isEqualToString: @"Protein"]) field = @"[PROT]"; else if([field isEqualToString: @"UID"]) field = @"[UID]"; //NSLog(@"Field: %@", field); } if(field) [str appendString: field]; */ // QUERY // Remove other strange characters // query = [NSMutableString stringWithString: (NSString *) CFURLCreateStringByAddingPercentEscapes (NULL, (CFStringRef) query, NULL, NULL, kCFStringEncodingMacRoman)]; //NSLog(@"Search: %@", str); if ( ![self _canConnect] ) { [progressTextField setStringValue: @"Unable to contact NCBI. Please provide an internet connection."]; [self NCBIconnectionError: @"not reachable"]; return; } receivedData = [[NSMutableData alloc] init]; NSURLRequest *theRequest = [NSURLRequest requestWithURL: [NSURL URLWithString: str] cachePolicy: NSURLRequestReloadIgnoringCacheData timeoutInterval: 20.0]; if ( !theRequest) { [progressTextField setStringValue: @"Unable to generate query. Check for any inapropriate characters in your query."]; [self NCBIconnectionError: @"no request"]; return; } connection = [NSURLConnection connectionWithRequest: theRequest delegate:self]; if ( !connection ) { [progressTextField setStringValue: @"Unable to generate query. Check for any inapropriate characters in your query."]; [self NCBIconnectionError: @"connection failure"]; return; } [connection retain]; } - (BOOL)parseSearchResults: (NSData *)results{ SXMLTree *xmldata = nil; BOOL success = YES; searchcount = 0; NS_DURING xmldata = [[SXMLTree alloc] initFromData: results usingEncoding: NSASCIIStringEncoding]; //NSLog(@"XML: %@", xmldata); NS_HANDLER //NSLog(@"Error initializing SXMLTree from output"); success = NO; NS_ENDHANDLER if([xmldata findRoot] == nil) return NO; // First check for found items NS_DURING [self setWebenv: [[xmldata childWithPath: @"/eSearchResult/WebEnv"]nodeText]]; [self setQuerykey: [[xmldata childWithPath: @"/eSearchResult/QueryKey"]nodeText]]; searchcount = [[[xmldata childWithPath: @"/eSearchResult/Count"]nodeText] intValue]; //NSLog(@"%@", [[xmldata childWithPath: @"/eSearchResult/Count"]nodeText]); //NSLog(@"%@", [[xmldata childWithPath: @"/eSearchResult/WebEnv"]nodeText]); //NSLog(@"%@", [[xmldata childWithPath: @"/eSearchResult/QueryKey"]nodeText]); NS_HANDLER //NSLog(@"Error extracting webenv"); success = NO; NS_ENDHANDLER [self cleanupDownload]; return success; } - (void)retrieveSummaries{ // PREPARE //[progress setIndeterminate: YES]; [progress startAnimation: self]; [progressTextField setStringValue: @"Receiving results from NCBI..."]; summaryFetchInProgress = YES; NSString *query = [NSString stringWithFormat: @"http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=nucleotide&retmode=xml&retmax=150&retstart=%d&WebEnv=%@&query_key=%@", fetchedResults, [self webenv], [self querykey]]; //NSLog(@"Retrieve: %@", query); if(!query || [query isEqualToString: @""]){ NSBeep(); [progressTextField setStringValue: @"Error while retrieving summaries. Please try again."]; [self cleanupDownload]; return; } if ( ![self _canConnect] ) { [self NCBIconnectionError: @"not reachable"]; [progressTextField setStringValue: @"Unable to contact NCBI. Please provide an internet connection."]; return; } receivedData = [[NSMutableData alloc] init]; NSURLRequest *theRequest = [NSURLRequest requestWithURL: [NSURL URLWithString: query] cachePolicy: NSURLRequestReloadIgnoringCacheData timeoutInterval: 20.0]; if ( !theRequest) { [progressTextField setStringValue: @"Unable to generate query. Check for any inapropriate characters in your query."]; [self NCBIconnectionError: @"no request"]; return; } connection = [NSURLConnection connectionWithRequest: theRequest delegate:self]; if ( !connection ) { [progressTextField setStringValue: @"Unable to generate query. Check for any inapropriate characters in your query."]; [self NCBIconnectionError: @"connection failure"]; return; } [connection retain]; } - (BOOL)parseSummaries: (NSData *)results{ SXMLTree *xmldata = nil; SXMLTree *theXMLHitSet = nil; NSString *db_id = nil; NSString *accession = nil; NSString *extra = nil; NSString *description = nil; NSString *species = nil; BOOL success = YES; NS_DURING xmldata = [[SXMLTree alloc] initFromData: results usingEncoding: NSASCIIStringEncoding]; //NSLog(@"XML: %@", xmldata); NS_HANDLER //NSLog(@"Error initializing SXMLTree from output"); success = NO; NS_ENDHANDLER if([xmldata findRoot] == nil) return NO; // First check for found items // REMOVE PREVIOUS RESULTS [searchResults removeAllObjects]; //TEST //Fetch important data from the XML entry //SXMLTree *theXMLOutput = [results childWithPath:@"/BlastOutput"]; NS_DURING theXMLHitSet = [xmldata childWithPath: @"/eSummaryResult"]; NS_HANDLER //NSLog(@"Error initializing SXMLTree from output"); success = NO; NS_ENDHANDLER if(!success) return NO; // DO THESE KIND OF CHECKS! int theHitCount = [theXMLHitSet childCount]; int i; for (i=0; i< theHitCount; i++) { NS_DURING SXMLTree *theXMLHit = [theXMLHitSet childAtIndex:i]; db_id = [[theXMLHit childWithPath: @"Id"] nodeText]; accession = [[theXMLHit childAtIndex: 1] nodeText]; description = [[theXMLHit childAtIndex: 2] nodeText]; extra = [[theXMLHit childAtIndex: 3] nodeText]; species = [[theXMLHit childAtIndex: 8] nodeText]; NS_HANDLER //NSLog(@"Error initializing SXMLTree from output"); success = NO; NS_ENDHANDLER if(db_id){ EntrezResult *result = [[EntrezResult alloc] initWithID: [db_id intValue]]; if(accession) [result setAccession: accession]; if(extra) [result setExtra: extra]; if(description)[result setDescription: description]; if(species) [result setSpecies: species]; [searchResults addObject: result]; [result release]; } else success = NO; } [searchResults sortUsingSelector: @selector(sortResultsOnIdAscending:)]; [tv reloadData]; /* if(success && searchcount > fetchedResults + 50){ fetchedResults += 50; //[searchButton setTitle: @"More"]; } else { fetchedResults = 0; //[searchButton setTitle: @"Search"]; } */ [self showPreview: self]; [self cleanupDownload]; return success; } - (void)fetchResult: (EntrezResult *)result{ // PREPARE [progress startAnimation: self]; [progressTextField setStringValue: @"Retrieving record..."]; fetchInProgress = YES; NSString *query = [NSString stringWithFormat: @"http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=%d&retmode=xml&rettype=fasta", [result db_id]]; //NSLog(@"Retrieve: %@", query); if(!query || [query isEqualToString: @""]){ NSBeep(); [progressTextField setStringValue: @"Error while retrieving record. Please try again."]; [self cleanupDownload]; return; } if ( ![self _canConnect] ) { [progressTextField setStringValue: @"Unable to contact NCBI. Please provide an internet connection."]; [self NCBIconnectionError: @"not reachable"]; return; } receivedData = [[NSMutableData alloc] init]; NSURLRequest *theRequest = [NSURLRequest requestWithURL: [NSURL URLWithString: query] cachePolicy: NSURLRequestReloadIgnoringCacheData timeoutInterval: 20.0]; if ( !theRequest) { [progressTextField setStringValue: @"Unable to generate query. Check for any inapropriate characters in your query."]; [self NCBIconnectionError: @"no request"]; return; } connection = [NSURLConnection connectionWithRequest: theRequest delegate:self]; if ( !connection ) { [progressTextField setStringValue: @"Unable to generate query. Check for any inapropriate characters in your query."]; [self NCBIconnectionError: @"connection failure"]; return; } [connection retain]; } - (BOOL)parseFetch: (NSData *)results{ SXMLTree *xmldata = nil; NSString *seq = nil; BOOL success = YES; NS_DURING xmldata = [[SXMLTree alloc] initFromData: results usingEncoding: NSASCIIStringEncoding]; //NSLog(@"XML: %@", xmldata); NS_HANDLER //NSLog(@"Error initializing SXMLTree from output"); success = NO; NS_ENDHANDLER if([xmldata findRoot] == nil) return NO; // First check for found items if(!success) return NO; // DO THESE KIND OF CHECKS! //Fetch important data from the XML entry NS_DURING seq = [[xmldata childWithPath: @"/TSeqSet/TSeq/TSeq_sequence"] nodeText]; NS_HANDLER success = NO; //NSLog(@"Error extracting sequence"); NS_ENDHANDLER if(seq){ int row = [tv selectedRow]; EntrezResult *res = [searchResults objectAtIndex: row]; NSString *name = [NSString stringWithFormat: @"%@ %@", [res accession], [res description]]; if([name length] > 50) name = [NSString stringWithFormat: @"%@...", [name substringWithRange: NSMakeRange(0, 50)]]; id del = [self delegate]; if ([del respondsToSelector:@selector(insertFetchedSequence:withName:)]){ [del insertFetchedSequence: seq withName: name]; } } else success = NO; [self cleanupDownload]; [NSApp endSheet: [self window] returnCode: 1]; [[self window] orderOut: self]; return success; } - (void)cleanupDownload{ [progress stopAnimation: self]; //[progress setIndeterminate: NO]; //[progress setDoubleValue: 0.0]; //[progressTextField setStringValue: @""]; searchInProgress = NO; summaryFetchInProgress = NO; fetchInProgress = NO; if(receivedData != nil){ [receivedData release]; receivedData = nil; } if ( connection != nil ) { [connection cancel]; [connection release]; connection = nil; } if ( response != nil ) { [response release]; response = nil; } } - (void)reportDownloadFailureWithError: (NSString *)errorstring{ } - (void) NCBIconnectionError: (id) anError { /* // Unused now, but in case we really want to use it it would be in line with the following // (taken from John Timmer's 4Peaks Ensembl plugin implementation) // the argument will either come in as a string, or as the NSURLConnection's // NSError, which we reformat NSMutableDictionary *tempDict; if ( [anError isKindOfClass: [NSError class] ] ) { tempDict = [NSMutableDictionary dictionaryWithObject: [anError localizedDescription] forKey: @"title"]; [tempDict setObject: NSLocalizedString( @"There were problems loading a URL from ENSEMBL. Please check whether the ENSEMBL website is working.", @"ENSEMBL URL Loading Error description" ) forKey: @"description"]; theBLASTError = [[NSError errorWithDomain: @"4Peaks Analysis error" code: 100 userInfo: tempDict] retain]; } else { if ( [anError isEqualToString: @"not reachable"] ) { tempDict = [NSMutableDictionary dictionaryWithObject: NSLocalizedString( @"Network Unavailable", @"No Network Error title" ) forKey: @"title"]; [tempDict setObject: NSLocalizedString( @"This search requires an active network and there is no connection currently available. Please try again when you have network access.", @"No Network Error description" ) forKey: @"description"]; theBLASTError = [ [NSError errorWithDomain: @"4Peaks Analysis error" code: 100 userInfo: tempDict] retain]; } if ( [anError isEqualToString: @"connection failure"] ) { tempDict = [NSMutableDictionary dictionaryWithObject: NSLocalizedString( @"Network Timeout", @"Network Timeout Error title") forKey: @"title"]; [tempDict setObject: NSLocalizedString( @"The attempt to reach ENSEMBL has timed out. Please ensure that you can connect to ENSEMBL and then try again.", @"Network Timeout Error description") forKey: @"description"]; theBLASTError = [ [NSError errorWithDomain: @"4Peaks Analysis error" code: 102 userInfo: tempDict] retain]; } */ } // ================================================================ #pragma mark --- DOWNLOAD ACCESSORS // ================================================================ - (NSURLResponse *)response { return response; } - (void)setResponse:(NSURLResponse *)newResponse { [newResponse retain]; [response release]; response = newResponse; } - (NSString *)webenv { return webenv; } - (void)setWebenv:(NSString *)newWebenv { [newWebenv retain]; [webenv release]; webenv = newWebenv; } - (NSString *)querykey { return querykey; } - (void)setQuerykey:(NSString *)newQuerykey { [newQuerykey retain]; [querykey release]; querykey = newQuerykey; } // ================================================================ #pragma mark --- CONNECTION DELEGATES // ================================================================ - (void) connection: (NSURLConnection *)theConnection didReceiveResponse: (NSURLResponse *)theresponse { // NSLog(@"Response: %@", theresponse); // Apple says to clear the data in the case of a redirect // we pretty much trust Apple on this [receivedData setLength: 0]; // retain the response to use later [self setResponse: theresponse]; bytesReceived = 0; [progressTextField setStringValue: @"Connected to NCBI..."]; } - (void) connection: (NSURLConnection *)connection didReceiveData: (NSData *)data { //NSLog(@"Bytes received - %d", [data length]); // append the new data to the receivedData [receivedData appendData:data]; bytesReceived = bytesReceived + [data length]; if(searchInProgress) [progressTextField setStringValue: [NSString stringWithFormat: @"Receiving results from NCBI... (%dKb)", bytesReceived/1024]]; else if (summaryFetchInProgress) [progressTextField setStringValue: [NSString stringWithFormat: @"Receiving record from NCBI... (%dKb)", bytesReceived/1024]]; } - (void)connection: (NSURLConnection *)connection didFailWithError: (NSError *)error { // forward the actual error to our error generation routine [self NCBIconnectionError: error]; [progressTextField setStringValue: [NSString stringWithFormat: @"Error: %@", [error localizedDescription]]]; [self cleanupDownload]; } - (void)connectionDidFinishLoading:(NSURLConnection *)connection { //NSLog(@"Received: %@", [NSString stringWithUTF8String: [receivedData bytes]]); if(searchInProgress){ if([self parseSearchResults: receivedData]){ [self cleanupDownload]; [progressTextField setStringValue: @"Parsing received records..."]; [self retrieveSummaries]; } else { [self NCBIconnectionError: @"error parsing search results"]; [progressTextField setStringValue: @"No results found."]; [self cleanupDownload]; } } else if (summaryFetchInProgress){ if([self parseSummaries: receivedData]){ [self cleanupDownload]; [progressTextField setStringValue: [NSString stringWithFormat: @"%d records found.", searchcount]]; } else { [self NCBIconnectionError: @"error parsing summaries"]; [progressTextField setStringValue: @"No results found."]; [self cleanupDownload]; } } else if (fetchInProgress){ if([self parseFetch: receivedData]){ [self cleanupDownload]; [progressTextField setStringValue: @""]; } else { [self NCBIconnectionError: @"error parsing record"]; [progressTextField setStringValue: @"Error parsing record."]; [self cleanupDownload]; } } } //=========================================================================== #pragma mark - #pragma mark GENERAL METHODS //=========================================================================== - (BOOL)parseOutput: (NSData *)output{ // Debugging method to parse the output, disabled here. /* SXMLTree *xmldata, *theXMLHitSet; NS_DURING xmldata = [[SXMLTree alloc] initFromData: output usingEncoding:NSASCIIStringEncoding]; NS_HANDLER NSLog(@"Error initializing SXMLTree from output"); NS_ENDHANDLER if([xmldata findRoot] == nil) return NO; [self setResults: xmldata]; [xmldata release]; //TEST //Fetch important data from the XML entry //SXMLTree *theXMLOutput = [results childWithPath:@"/BlastOutput"]; NS_DURING theXMLHitSet = [[self results] childWithPath: @"/BlastOutput/BlastOutput_iterations/Iteration/Iteration_hits"]; NS_HANDLER NSLog(@"Error initializing SXMLTree from output"); NS_ENDHANDLER int theHitCount = [theXMLHitSet childCount]; int i; for (i=0; i< theHitCount; i++) { NS_DURING SXMLTree *theXMLHit = [theXMLHitSet childAtIndex:i]; NS_HANDLER NSLog(@"Error initializing SXMLTree from output"); NS_ENDHANDLER //NSLog(@"%@", [[theXMLHit childWithPath: @"Hit_def"]nodeText]); } // runstatistics // results // querystatistics return [self resultsAvailable]; */ return YES; } - (BOOL)validateMenuItem:(NSMenuItem *)anItem{ if([[anItem title] isEqualToString: @"Recent Searches"]) return NO; else return YES; } ///////////////////////////////////////////////////// // a private method to determine network availability ///////////////////////////////////////////////////// - (BOOL) _canConnect { Boolean result; SCNetworkConnectionFlags flags; assert(sizeof(SCNetworkConnectionFlags) == sizeof(int)); result = NO; if ( SCNetworkCheckReachabilityByName([[NSString stringWithString:@"eutils.ncbi.nlm.nih.gov"] UTF8String], &flags) ) { result = (flags & kSCNetworkFlagsReachable); } return result; } @end biococoa-2.2.2/BCAppKit/KDTextView.h000644 000765 000024 00000004721 11223237412 017502 0ustar00scottcstaff000000 000000 // // KDTextView.h // LineNumbering // // Created by Koen van der Drift on Sat May 01 2004. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import @interface KDTextView : NSTextView { BOOL drawNumbersInMargin; BOOL drawLineNumbers; BOOL drawOverlay; NSMutableDictionary *marginAttributes; NSMutableDictionary *selectionAttributes; NSString *unit; } -(void)initLineMargin:(NSRect)frame; - (BOOL)drawNumbersInMargin; - (void)setDrawNumbersInMargin:(BOOL)newDrawNumbersInMargin; - (BOOL)drawLineNumbers; - (void)setDrawLineNumbers:(BOOL)newDrawLineNumbers; - (BOOL)drawOverlay; - (void)setDrawOverlay:(BOOL)newDrawOverlay; - (NSString *)unit; - (void)setUnit:(NSString *)newUnit; -(void)updateMargin; -(void)updateLayout; -(void)drawEmptyMargin:(NSRect)aRect; -(void)drawNumbersInMargin:(NSRect)aRect; -(void)drawOneNumberInMargin:(unsigned) aNumber inRect:(NSRect)aRect; -(void)drawSelectionOverlayInTextview: (NSRect)rect; -(void)drawOverlayInTextview: (NSRect)rect; -(NSRect)marginRect; @end biococoa-2.2.2/BCAppKit/KDTextView.m000644 000765 000024 00000041067 11223237412 017513 0ustar00scottcstaff000000 000000 // // KDTextView.m // LineNumbering // // Created by Koen van der Drift on Sat May 01 2004. // Pimped by Alexander Griekspoor on Sat Mar 04 2006 // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // NSTextView subclass which adds: // - line numbering // - column spacing // - fancy overlays for mouse position and selections // - better information transmission on selections to the delegate // To be added in future versions: // - make columnwidth character based, instead of 90 points -> 10 chars // - calculate column width based on current font // - optimization by only redrawing dirty areas #import "KDTextView.h" #import "KDTextViewContainer.h" // Available delegate methods @protocol KDTextViewDelegate - (void)copy:(id)sender; - (void)didClickInTextView: (id)sender location: (NSPoint)thePoint character: (int)c; - (void)didDragInTextView: (id)sender location: (NSPoint)thePoint character: (int)c; - (void)didMoveInTextView: (id)sender location: (NSPoint)thePoint character: (int)c; - (void)didDragSelectionInTextView: (id)sender range: (NSRange)aRange; - (NSMenu *)menuForTextView: (id)sender; @end @implementation KDTextView - (id)initWithCoder:(NSCoder *)aDecoder; { if (self = [super initWithCoder:aDecoder]) { [self initLineMargin: [self frame]]; [self setUnit: @""]; } return self; } -(id)initWithFrame:(NSRect)frame { if (self = [super initWithFrame:frame]) { [self initLineMargin: frame]; [self setUnit: @""]; } return self; } - (void) initLineMargin:(NSRect) frame { NSSize contentSize; KDTextViewContainer *myContainer; // create a subclass of NSTextContainer that specifies the textdraw area. // This will allow for a left margin for numbering. contentSize = [[self enclosingScrollView] contentSize]; frame = NSMakeRect(0, 0, contentSize.width, contentSize.height); myContainer = [[KDTextViewContainer allocWithZone:[self zone]] initWithContainerSize:NSMakeSize(frame.size.width, 100000)]; [myContainer setWidthTracksTextView:YES]; [myContainer setHeightTracksTextView:NO]; // This controls the inset of our text away from the margin. [myContainer setLineFragmentPadding:7]; [self replaceTextContainer:myContainer]; [myContainer release]; // set all the parameters for the text view - it's was created from scratch, so it doesn't use // the values from the Nib file. [self setMinSize:frame.size]; [self setMaxSize:NSMakeSize(100000, 100000)]; [self setHorizontallyResizable:NO]; [self setVerticallyResizable:YES]; [self setAutoresizingMask:NSViewWidthSizable]; [self setAllowsUndo:YES]; [self setFont:[NSFont fontWithName: @"Courier" size: 14]]; // listen to updates from the window to force a redraw - eg when the window resizes. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidUpdate:) name:NSWindowDidUpdateNotification object:[self window]]; marginAttributes = [[NSMutableDictionary alloc] init]; [marginAttributes setObject:[NSFont boldSystemFontOfSize:8] forKey: NSFontAttributeName]; [marginAttributes setObject:[NSColor darkGrayColor] forKey: NSForegroundColorAttributeName]; selectionAttributes = [[NSMutableDictionary alloc] init]; [selectionAttributes setObject:[NSFont boldSystemFontOfSize:9] forKey: NSFontAttributeName]; [selectionAttributes setObject:[NSColor whiteColor] forKey: NSForegroundColorAttributeName]; drawNumbersInMargin = YES; drawLineNumbers = NO; drawOverlay = YES; } - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [marginAttributes release]; [selectionAttributes release]; [unit release]; [super dealloc]; } - (BOOL)drawNumbersInMargin { return drawNumbersInMargin; } - (void)setDrawNumbersInMargin:(BOOL)newDrawNumbersInMargin { drawNumbersInMargin = newDrawNumbersInMargin; } - (BOOL)drawLineNumbers { return drawLineNumbers; } - (void)setDrawLineNumbers:(BOOL)newDrawLineNumbers { drawLineNumbers = newDrawLineNumbers; } - (BOOL)drawOverlay { return drawOverlay; } - (void)setDrawOverlay:(BOOL)newDrawOverlay { drawOverlay = newDrawOverlay; } // displayed in the selection marker, e.g. set to bp for DNA and aa for amino acids // format: 187-195 (8 $UNIT) - (NSString *)unit { return unit; } - (void)setUnit:(NSString *)newUnit { [newUnit retain]; [unit release]; unit = newUnit; } - (void)drawRect:(NSRect)aRect { [super drawRect:aRect]; [self drawEmptyMargin: [self marginRect]]; // line numbers if ( drawNumbersInMargin ) { [self drawNumbersInMargin: [self marginRect]]; } // overlays, not when printed. if ( drawOverlay && [[NSGraphicsContext currentContext] isDrawingToScreen]) { [self drawSelectionOverlayInTextview: aRect]; [self drawOverlayInTextview: aRect]; } } - (void)windowDidUpdate:(NSNotification *)notification { [self updateMargin]; } - (void)updateLayout { [self updateMargin]; } -(void)updateMargin { [self setNeedsDisplayInRect:[self marginRect] avoidAdditionalLayout:NO]; } -(NSRect)marginRect { NSRect r; r = [self bounds]; r.size.width = kLEFT_MARGIN_WIDTH; return r; } -(void)drawEmptyMargin:(NSRect)aRect { /* These values control the color of our margin. Giving the rect the 'clear' background color is accomplished using the windowBackgroundColor. Change the color here to anything you like to alter margin contents. */ if([[NSGraphicsContext currentContext] isDrawingToScreen]){ [[NSColor controlHighlightColor] set]; [NSBezierPath fillRect: aRect]; } // These points should be set to the left margin width. NSPoint top = NSMakePoint(aRect.size.width, [self bounds].size.height); NSPoint bottom = NSMakePoint(aRect.size.width, 0); // This draws the dark line separating the margin from the text area. [[NSColor grayColor] set]; [NSBezierPath setDefaultLineWidth:0.75]; [NSBezierPath strokeLineFromPoint:top toPoint:bottom]; } -(void) drawNumbersInMargin:(NSRect)aRect; { UInt32 index, lineNumber; NSRange lineRange; NSRect lineRect; NSLayoutManager* layoutManager = [self layoutManager]; NSTextContainer* textContainer = [self textContainer]; // Only get the visible part of the scroller view NSRect documentVisibleRect = [[self enclosingScrollView] documentVisibleRect]; // Find the glyph range for the visible glyphs NSRange glyphRange = [layoutManager glyphRangeForBoundingRect: documentVisibleRect inTextContainer: textContainer]; // Calculate the start and end indexes for the glyphs unsigned start_index = glyphRange.location; unsigned end_index = glyphRange.location + glyphRange.length; if(![[NSGraphicsContext currentContext] isDrawingToScreen]){ start_index = 0; end_index = [layoutManager numberOfGlyphs]; } index = 0; lineNumber = 1; if([[NSGraphicsContext currentContext] isDrawingToScreen]){ // Skip all lines that are visible at the top of the text view (if any) while (index < start_index) { lineRect = [layoutManager lineFragmentRectForGlyphAtIndex:index effectiveRange:&lineRange]; index = NSMaxRange( lineRange ); ++lineNumber; } } for ( index = start_index; index < end_index; lineNumber++ ) { lineRect = [layoutManager lineFragmentRectForGlyphAtIndex:index effectiveRange:&lineRange]; //NSLog(@"Rect: %f, %f, %f, %f", lineRect.origin.x, lineRect.origin.y, lineRect.size.width, lineRect.size.height); if ( drawLineNumbers && lineRect.origin.x == 30) { index = NSMaxRange( lineRange ); [self drawOneNumberInMargin:lineNumber inRect:lineRect]; } else if ( lineRect.origin.x == 30) // draw character numbers { [self drawOneNumberInMargin:index+1 inRect:lineRect]; } index = NSMaxRange( lineRange ); } if ( drawLineNumbers ) { lineRect = [layoutManager extraLineFragmentRect]; [self drawOneNumberInMargin:lineNumber inRect:lineRect]; } } -(void)drawOneNumberInMargin:(unsigned) aNumber inRect:(NSRect)r { NSString *s; NSSize stringSize; s = [NSString stringWithFormat:@"%d", aNumber, nil]; stringSize = [s sizeWithAttributes:marginAttributes]; // Simple algorithm to center the line number next to the glyph. [s drawAtPoint: NSMakePoint( r.origin.x - stringSize.width - 1, r.origin.y + ((r.size.height / 2) - (stringSize.height / 2))) withAttributes:marginAttributes]; } -(void)drawSelectionOverlayInTextview: (NSRect)rect{ // don't draw when margin is drawn if(NSWidth(rect) == 30) return; NSRange range = [self selectedRange]; NSString *s; NSSize stringSize; NSRect stringRect; NSBezierPath *stringPath; NSPoint p; if(range.length > 0){ // calculate rect of 1st char of selection NSRect r = [[self layoutManager] boundingRectForGlyphRange: NSMakeRange(range.location, 1) inTextContainer: [self textContainer]]; p = (NSPoint){r.origin.x, NSMaxY(r)}; // generate string if(range.length == 1) s = [NSString stringWithFormat:@"%d", range.location+1]; else s = [NSString stringWithFormat:@"%d-%d (%d%@)", range.location+1, range.location+range.length, range.length, [self unit]]; stringSize = [s sizeWithAttributes:selectionAttributes]; // position with respect to character stringRect.origin.x = p.x + 5.0; stringRect.origin.y = p.y - stringSize.height - 16.0; // if doesn't fit (to close to top), move to last char of selection if(stringRect.origin.y - 15.0 < rect.origin.y){ NSRect r = [[self layoutManager] boundingRectForGlyphRange: NSMakeRange(range.location + range.length - 1, 1) inTextContainer: [self textContainer]]; stringRect.origin.x = NSMaxX(r) - stringSize.width; stringRect.origin.y = NSMaxY(r) + 2.0; } // if doesn't fit (to close to right edge), reposition if((stringRect.origin.x + stringSize.width + 10.0) > rect.origin.x + NSWidth(rect)) stringRect.origin.x -= (stringRect.origin.x + stringSize.width + 10.0) - (rect.origin.x + NSWidth(rect)); // if doesn't fit (to close to left edge), reposition // NOTE: HARDCODED MARGIN WIDTH + 5 -> room for more elegant solution here if(stringRect.origin.x < 35.0) stringRect.origin.x = 35.0; // draw overlay + text stringRect.size = stringSize; stringPath = [NSBezierPath bezierPath]; [stringPath moveToPoint: (NSPoint) {stringRect.origin.x, stringRect.origin.y + 7.0}]; [stringPath lineToPoint: (NSPoint) {stringRect.origin.x + stringRect.size.width, stringRect.origin.y + 7.0}]; [stringPath setLineCapStyle: NSRoundLineCapStyle]; [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.6]set]; [stringPath setLineWidth: stringSize.height]; [stringPath stroke]; [s drawAtPoint: stringRect.origin withAttributes:selectionAttributes]; } } -(void)drawOverlayInTextview: (NSRect)rect{ // where are we? NSPoint cursor = [self convertPoint: [[self window] mouseLocationOutsideOfEventStream] fromView: nil]; // not in margin, not outside ourselves if(cursor.x < 30.0) return; if(!NSPointInRect(cursor, rect)) return; NSTextStorage* textStorage = [self textStorage]; NSRange selectedRange = [self selectedRange]; NSString *s; NSSize stringSize; NSRect stringRect; NSBezierPath *stringPath; // don't draw if active selection if(selectedRange.length > 0){ return; // what's the char under our mouse } else { float partial = 1.0; int c = (int) [[self layoutManager] glyphIndexForPoint: cursor inTextContainer: [self textContainer] fractionOfDistanceThroughGlyph: &partial]; if(c > 0 && c < [textStorage length] - 1) s = [NSString stringWithFormat:@"%d", c+1]; else return; } stringSize = [s sizeWithAttributes:selectionAttributes]; // position with respect to char stringRect.origin.x = cursor.x + 8.0; stringRect.origin.y = cursor.y + stringSize.height + 2.0; // if doesn't fit (to close to right edge), reposition if((stringRect.origin.x + stringSize.width + 10.0) > rect.origin.x + NSWidth(rect)) stringRect.origin.x -= (stringRect.origin.x + stringSize.width + 10.0) - (rect.origin.x + NSWidth(rect)); // if doesn't fit (to close to bottom edge), reposition if((stringRect.origin.y + stringSize.height + 10.0) > rect.origin.y + NSHeight(rect)) stringRect.origin.y -= (stringRect.origin.y + stringSize.height + 10.0) - (rect.origin.y + NSHeight(rect)); // draw overlay + text stringRect.size = stringSize; stringPath = [NSBezierPath bezierPath]; [stringPath moveToPoint: (NSPoint) {stringRect.origin.x, stringRect.origin.y + 7.0}]; [stringPath lineToPoint: (NSPoint) {stringRect.origin.x + stringRect.size.width, stringRect.origin.y + 7.0}]; [stringPath setLineCapStyle: NSRoundLineCapStyle]; [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.6]set]; [stringPath setLineWidth: stringSize.height]; [stringPath stroke]; [s drawAtPoint: stringRect.origin withAttributes:selectionAttributes]; } // Allows customization of contextual menu by delegate -(NSMenu*)menuForEvent:(NSEvent*) evt { id delegate = [self delegate]; if ([delegate respondsToSelector:@selector(menuForTextView:)]) return [delegate menuForTextView: self]; return nil; } // Mouse methods that inform delegate - (void)mouseDown:(NSEvent *)theEvent{ id delegate = [self delegate]; float partial = 0.5; NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil]; if ([delegate respondsToSelector:@selector(didClickInTextView: location: character:)]){ int c = (int) [[self layoutManager] glyphIndexForPoint: p inTextContainer: [self textContainer] fractionOfDistanceThroughGlyph: &partial]; [delegate didClickInTextView: self location: p character: c]; } // redraw to sync overlays [self setNeedsDisplay: YES]; [super mouseDown: theEvent]; } - (void)mouseMoved:(NSEvent *)theEvent{ float partial = 1.0; NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil]; int c = (int) [[self layoutManager] glyphIndexForPoint: p inTextContainer: [self textContainer] fractionOfDistanceThroughGlyph: &partial]; id delegate = [self delegate]; if ([delegate respondsToSelector:@selector(didMoveInTextView: location: character:)]){ [delegate didMoveInTextView: self location: p character: c]; } // redraw to sync overlays [self setNeedsDisplay: YES]; [super mouseMoved: theEvent]; } - (void)mouseEntered:(NSEvent *)theEvent{ // redraw to sync overlays [self setNeedsDisplay: YES]; [super mouseEntered: theEvent]; } - (void)mouseExited:(NSEvent *)theEvent{ // redraw to sync overlays [self setNeedsDisplay: YES]; [super mouseExited: theEvent]; } - (NSRange)selectionRangeForProposedRange:(NSRange)proposedCharRange granularity:(NSSelectionGranularity)granularity{ // DRAGGING SELECTION, inform delegate id delegate = [self delegate]; if ([delegate respondsToSelector:@selector(didDragSelectionInTextView:range:)]){ [delegate didDragSelectionInTextView: self range: proposedCharRange]; } // MAKE SURE THAT SELECTION IS REDRAWN DURING DRAG [self setNeedsDisplay: YES]; return [super selectionRangeForProposedRange:proposedCharRange granularity:granularity]; } - (void)setSelectedRange:(NSRange)aRange{ // MAKE SURE THAT SELECTION IS REDRAWN DURING DRAG [self setNeedsDisplay: YES]; [super setSelectedRange: aRange]; } @end biococoa-2.2.2/BCAppKit/KDTextViewContainer.h000644 000765 000024 00000003543 11223237412 021346 0ustar00scottcstaff000000 000000 // // KDTextViewContainer.h // LineNumbering // // Created by Koen van der Drift on Sat May 01 2004. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* TextViewContainer subclass corrects for the 30 point indent needed for the linenumber margin */ #import #define kLEFT_MARGIN_WIDTH 30; @interface KDTextViewContainer : NSTextContainer { float columnWidth; } - (float) columnWidth; - (void) setColumnWidth:(float) width; @end biococoa-2.2.2/BCAppKit/KDTextViewContainer.m000644 000765 000024 00000005601 11223237412 021350 0ustar00scottcstaff000000 000000 // // KDTextViewContainer.m // LineNumbering // // Created by Koen van der Drift on Sat May 01 2004. // Copyright (c) 2003-2009 The BioCocoa Project. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import "KDTextViewContainer.h" @implementation KDTextViewContainer - (id) initWithContainerSize:(NSSize) size { self = [super initWithContainerSize:size]; // default columnwidth (width of 10 characters in Courier 12) columnWidth = 90.0; return self; } - (BOOL) isSimpleRectangularTextContainer { return NO; } - (void) setColumnWidth:(float) width { columnWidth = width; [[self layoutManager] textContainerChangedGeometry:self]; } - (float) columnWidth { return columnWidth; } - (NSRect)lineFragmentRectForProposedRect:(NSRect)proposedRect sweepDirection:(NSLineSweepDirection)sweepDirection movementDirection:(NSLineMovementDirection)movementDirection remainingRect:(NSRect *)remainingRect { if(proposedRect.origin.x <= 0.0) proposedRect.origin.x = kLEFT_MARGIN_WIDTH; proposedRect.size.width = columnWidth; if (proposedRect.origin.x + 2 * columnWidth - 20.0 >= [self containerSize].width) *remainingRect = NSZeroRect; else { remainingRect->origin.x = proposedRect.origin.x + columnWidth - 10.0; remainingRect->origin.y = proposedRect.origin.y; remainingRect->size.width = [self containerSize].width - proposedRect.origin.x - columnWidth; remainingRect->size.height = proposedRect.size.height; } return proposedRect; } @end