- Copy the file NewSelectRandomGenesSingles.java from the bootstrap/sequence/ directory of the toolkit to your current working directory. Also, copy the files SequenceReader.java, SequenceUtilities.java, ExtractGenes.java, and AminoAcidSinglePreference.java from the utils/ directory of the toolkit to your current working directory.
- Compile this suite of java files by issuing the command:
javac NewSelectRandomGenesSingles.java
Since this file uses all of the other java files, it will force those files to be compiled during the compilation process.
- Create three files that represent a database of the genomes one is interested in sampling from.
- The first file should contain full pathnames to the FASTA files to use as the genome sampling set.
- The second file should contain full pathnames to the gene files to use as the genome sampling set. This file should be in the same order as the first file.
- The third file should contain full pathnames to the FASTA files to use as the genome sampling set, with each FASTA filename followed by a colon (":") and the type of genome for that file (SSDNA, DSDNA, RETROID). This file should also be in the same order as the database of FASTA files.
Examples of these three files can be found in dataFiles/virusFASTA.db, dataFiles/virusGenes.db, and dataFiles/virusTypes.db respectively.
- The underlying algorithm for sequence bootstrapping is:
- Select a random genome from the database.
- Select a random gene from the chosen genome.
- Select a random subsection of the chosen gene that is of a specific size (set by the user) and count the amino acids seen in that subsection.
- Repeat selecting random genes and subsections of genes with replacement, adding the new count of each amino acid to the previous count.
- Once enough random subsections have been selected to generate a profile of size set by the user, normalize the total counts of amino acids seen.
- Output the single amino acid preference profile created by this process.
- Repeat selecting random genomes with replacement until the specified number (set by the user) of random profiles is generated.
- To generate random samples of amino acid data based on the underlying database of genomes referenced by the files above, execute the following command:
java NewSelectRandomGenesSingles pathToFASTADatabase pathToGenesDatabase pathToTypesDatabase numberOfInputFiles numberOfRandomSamplesToGenerate sizeInAminosOfRandomSamplesToGenerate chunkSizeToSelectFromEachGene outputDirectoryPathName
Each parameter is described below:
- pathToFastaDatabase - Path to the database of FASTA files to use (such as virusFASTA.db)
- pathToGenesDatabase - Path to the database of gene files to use (such as virusGenes.db)
- pathToTypesDatabase - Path to the database of types to use (such as virusTypes.db)
- numberOfInputFiles - Size of database (equal to the number of underlyng genomes => in the above db files, this is 236).
- numberOfRandomSamplesToGenerate - Total number of bootstrapped samples to generate
- sizeInAminosOfRandomSamplesToGenerate - Total size (in terms of aminos) of samples to generate.
- chunkSizeToSelectFromEachGene - Size of a gene (in terms of aminos) to use as a component of the total sample size.
- outputDirectoryPathName - Directory in which the output data should be stored.
As an example, to generate 1000 random samples, each having 660 amino acids selected in 60 amino acid chunks using the virusFASTA.db (which has 236 genomes) described above and desiring to store the data in the directory randomSamples/, use the following command:
java NewSelectRandomGenesSingles virusFASTA.db virusGenes.db virusTypes.db 236 1000 660 60 randomSamples/
- After execution, there should be five files in the output directory:
- randomClassificationTestGroup - This file contains all of the the single amino acid preference profiles generated by the program, formatted to be used with SVMLight for testing.
- randomClassificationTest.geneUsage - This file contains entries for each sample, referencing which part of each genome and gene was used in generating the sample. It is useful for verifying the sampling of genes.
- randomClassificationTest.testToTrue - This file contains entries for each sample, referencing the actual FASTA file that was used as the basis for the random samples. It is useful for verifying the sampling of genomes.
- randomClassificationTest.types - This file contains entries for each sample, referencing the true type of the genome from which the sample was generated. This file can be used as a basis for comparing against the outputs from a SVMLight classification run.
- classificationTestSequenceNames - This file can be ignored, as it is no longer required by other parts of the software.
The randomClassificationTestGroup file is formatted to be used with the SVMLight classification tool as a testing input. Every sample is on a separate line, and all features of samples are prefixed by their feature number, followed by a colon, followed by the feature value. For example, feature 1 with value 0.05 is labeled as 1:0.05. Since singles are selected using this program, there should be twenty features on each line of the output file. Each line of the file will also be started with a 0 value, indicating to SVMLight that no classification is currently known for this sample. All randomly generated samples are placed into the same output file so that they can be tested at one time by the SVMLight software.