Liston:Computer Scripts

From OpenWetWare

(Difference between revisions)
Jump to: navigation, search
m (Python Scripts)
m (Python Scripts)
Line 31: Line 31:
<table border=2>
<table border=2>
<tr><th>Script Name</th><th>Discription</th><th>Input File Format</th><th>Output File Format</th></tr>
<tr><th>Script Name</th><th>Discription</th><th>Input File Format</th><th>Output File Format</th></tr>
-
<tr><td>[[baseanno.py]]</td>
+
<tr><td>[[baseanno.py]] v1.0</td>
<td>Converts a file containing a list of annotations, as well as each of their respective start and stop indices, into a file containing a list of base indices, each followed by any annotations that apply at that specific base. Each line of the input file is expected to be whitespace-delaminated, however if your annotations  have spaces in them, the script can be made to enforce tab-delimitation. The output file is always tab-delaminated.</td>
<td>Converts a file containing a list of annotations, as well as each of their respective start and stop indices, into a file containing a list of base indices, each followed by any annotations that apply at that specific base. Each line of the input file is expected to be whitespace-delaminated, however if your annotations  have spaces in them, the script can be made to enforce tab-delimitation. The output file is always tab-delaminated.</td>
<td>[Annotation text] [Start Index] [End Index]</td>
<td>[Annotation text] [Start Index] [End Index]</td>
<td>[Base Index] [Annotation1] [Annotation2] ... [AnnotationX]</td></tr>
<td>[Base Index] [Annotation1] [Annotation2] ... [AnnotationX]</td></tr>
-
<tr><td>[[basediff.py]]</td>
+
<tr><td>[[basediff.py]] v1.2</td>
<td>Finds base differences between multiple aligned sequences in a single FASTA file and output a tab-delaminated txt file containing the base values for all the sequences at the index where the difference occurred. The script has many modifiers that change what is considered a difference.</td>
<td>Finds base differences between multiple aligned sequences in a single FASTA file and output a tab-delaminated txt file containing the base values for all the sequences at the index where the difference occurred. The script has many modifiers that change what is considered a difference.</td>
<td>FASTA file containing two or more aligned sequences</td>
<td>FASTA file containing two or more aligned sequences</td>
<td>.txt file in the following format: [Base index] [Seq 1 value] [Seq 2 value] ... [Seq N value]</td></tr>
<td>.txt file in the following format: [Base index] [Seq 1 value] [Seq 2 value] ... [Seq N value]</td></tr>
-
<tr><td>[[BPstats.py]]</td>
+
<tr><td>[[BPstats.py]] v1.2</td>
<td>Performs and outputs various statistical tests for each contig in a GSS basepile output. it is assumed that the information for each contig is 1000 bases long. The following statistics are outputted in a tab-delimitated list for each contig by the script:
<td>Performs and outputs various statistical tests for each contig in a GSS basepile output. it is assumed that the information for each contig is 1000 bases long. The following statistics are outputted in a tab-delimitated list for each contig by the script:
<ul>
<ul>
Line 50: Line 50:
<td>GSS Basepile output. 1000 bases per contig</td>
<td>GSS Basepile output. 1000 bases per contig</td>
<td>tab-deliminated list of the statistics for each contig</td></tr>
<td>tab-deliminated list of the statistics for each contig</td></tr>
-
<tr><td>[[gapstrip.py]]</td>  
+
<tr><td>[[gapstrip.py]] v1.0</td>  
<td>Removes all of the gaps (i.e. '-') that are common (i.e. at the same index) to all of the sequences in an aligned FASTA file. By default, the first sequence is considered the reference and is excluded from the analysis, but the number of sequences that are treated as such can be changed.</td>
<td>Removes all of the gaps (i.e. '-') that are common (i.e. at the same index) to all of the sequences in an aligned FASTA file. By default, the first sequence is considered the reference and is excluded from the analysis, but the number of sequences that are treated as such can be changed.</td>
<td>FASTA file containing two or more aligned sequences.</td>
<td>FASTA file containing two or more aligned sequences.</td>
<td>FASTA file same number of sequences as the input file but, with gaps removed</td></tr>  
<td>FASTA file same number of sequences as the input file but, with gaps removed</td></tr>  
-
<tr><td>sumqual.py</td>
+
<tr><td>[[sumqual.py]] v1.3</td>
<td>A script used in conjunction with the free aligner MUMmer and the free short read  assembler YASRA. Creates a file with a similar to the format to that of the .qual file YASRA outputs, except each base can have multiple sets of quality values. Uses a .qual file containing the quality scores of multiple contigs and the output file of MUMmer to make a "consensus" .qual file, which contains the quality values in terms of the reference. Given the reference used with MUMmer to get the alignment, sumqual can output a fasta file containing all the sequence for which there is no quality data.</td>
<td>A script used in conjunction with the free aligner MUMmer and the free short read  assembler YASRA. Creates a file with a similar to the format to that of the .qual file YASRA outputs, except each base can have multiple sets of quality values. Uses a .qual file containing the quality scores of multiple contigs and the output file of MUMmer to make a "consensus" .qual file, which contains the quality values in terms of the reference. Given the reference used with MUMmer to get the alignment, sumqual can output a fasta file containing all the sequence for which there is no quality data.</td>
<td><ul><li>FASTA file containing the sequence of multiple contigs</li>
<td><ul><li>FASTA file containing the sequence of multiple contigs</li>
<li>MUMmer output file</li></ul></td>
<li>MUMmer output file</li></ul></td>
<td>similar to .qual input file, except each base can hold the information from more than one contig</td></tr>
<td>similar to .qual input file, except each base can hold the information from more than one contig</td></tr>
-
<tr><td>[[qualtofa.py]]</td>
+
<tr><td>[[qualtofa.py]] v1.3</td>
<td>Selectively extracts the sequence from a quality file and outputs it to a FASTA file.  It is designed to be used in conjunction with sumqual.py and accepts its consensus-style output. Conflicting bases from a consensus-style output are condensed into IUPAC ambiguity codes.  It has an option to mask all bases with a quality value of less than a user-specified threshold.</td>
<td>Selectively extracts the sequence from a quality file and outputs it to a FASTA file.  It is designed to be used in conjunction with sumqual.py and accepts its consensus-style output. Conflicting bases from a consensus-style output are condensed into IUPAC ambiguity codes.  It has an option to mask all bases with a quality value of less than a user-specified threshold.</td>
<td>quality file (.qual); accepts sumqual.py's output</td>
<td>quality file (.qual); accepts sumqual.py's output</td>
<td>FASTA file</td></tr>
<td>FASTA file</td></tr>
</table>
</table>

Revision as of 05:57, 13 January 2010

This page contains the source code for some of the bioinformatics scripts used by the Liston Lab. Most of the scripts are written in Python 2.6.4 and are designed for Unix systems. A few are written as a list of unix commands designed to be executables.


Python Script Conventions

The scripts must be compiled using a Python compiler in the following format:

   python theScript.py [modifiers] <Arguments>. 

For example, in order to run the script sumqual.py one could enter the following into an Unix shell:

   python sumqual.py -c -v ../myQualFile.qual ../myMumFile

This would compile and run the script sumqual.py with the modifiers -c and -v, using myQualFile.qual and myMumFile as arguments. All of the scripts save their output in a file in the current working directory, with a name usually composed of some combination of the arguments and the name of the script. However, one can save the output anywhere, under any name, using the following technique:

   python sumqual.py -c -v ../myQualFile.qual ../myMumFile > ../myOutput.ext

The order in which the modifiers are given is not important, however, the order of the required arguments is important. For Example the above modifiers could be entered in the opposite order (-v -c), but the two file paths need to be in a predetermined order. Some scripts have modifiers that require arguments of their own. These modifier arguments should be written directly after their respective modifier. For example, if the above modifier, -c, had a argument, one would type,

   python sumqual.py -c theArgument -v ../myQualFile.qual ../myMumFile

Every Script has a description of what it does and how/when to use it in its source code. The list all the modifiers that the script supports and what they do is also included. A similar help menu can be viewed by calling the script with no arguments. For example, typing the following,

   python sumqual.py

would cause a help menu to be printed to the screen.

Python Scripts

Script NameDiscriptionInput File FormatOutput File Format
baseanno.py v1.0 Converts a file containing a list of annotations, as well as each of their respective start and stop indices, into a file containing a list of base indices, each followed by any annotations that apply at that specific base. Each line of the input file is expected to be whitespace-delaminated, however if your annotations have spaces in them, the script can be made to enforce tab-delimitation. The output file is always tab-delaminated. [Annotation text] [Start Index] [End Index] [Base Index] [Annotation1] [Annotation2] ... [AnnotationX]
basediff.py v1.2 Finds base differences between multiple aligned sequences in a single FASTA file and output a tab-delaminated txt file containing the base values for all the sequences at the index where the difference occurred. The script has many modifiers that change what is considered a difference. FASTA file containing two or more aligned sequences .txt file in the following format: [Base index] [Seq 1 value] [Seq 2 value] ... [Seq N value]
BPstats.py v1.2 Performs and outputs various statistical tests for each contig in a GSS basepile output. it is assumed that the information for each contig is 1000 bases long. The following statistics are outputted in a tab-delimitated list for each contig by the script:
  • Reference Match Length: The index of the last known base (i.e. not 'N')
  • Target Match Sum: The number of known bases (i.e. not 'N')
  • Coverage Proportion: proportion of 'Target match sum' to ' Reference match length'
  • Average Density: The average density value for all bases within ' Reference match length'
  • Median Density: median density of the entire range of density values
GSS Basepile output. 1000 bases per contig tab-deliminated list of the statistics for each contig
gapstrip.py v1.0 Removes all of the gaps (i.e. '-') that are common (i.e. at the same index) to all of the sequences in an aligned FASTA file. By default, the first sequence is considered the reference and is excluded from the analysis, but the number of sequences that are treated as such can be changed. FASTA file containing two or more aligned sequences. FASTA file same number of sequences as the input file but, with gaps removed
sumqual.py v1.3 A script used in conjunction with the free aligner MUMmer and the free short read assembler YASRA. Creates a file with a similar to the format to that of the .qual file YASRA outputs, except each base can have multiple sets of quality values. Uses a .qual file containing the quality scores of multiple contigs and the output file of MUMmer to make a "consensus" .qual file, which contains the quality values in terms of the reference. Given the reference used with MUMmer to get the alignment, sumqual can output a fasta file containing all the sequence for which there is no quality data.
  • FASTA file containing the sequence of multiple contigs
  • MUMmer output file
similar to .qual input file, except each base can hold the information from more than one contig
qualtofa.py v1.3 Selectively extracts the sequence from a quality file and outputs it to a FASTA file. It is designed to be used in conjunction with sumqual.py and accepts its consensus-style output. Conflicting bases from a consensus-style output are condensed into IUPAC ambiguity codes. It has an option to mask all bases with a quality value of less than a user-specified threshold. quality file (.qual); accepts sumqual.py's output FASTA file
Personal tools