 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
23 "Usage: bseqaln [options] input.seq output.seq",
24 "---------------------------------------------",
25 "Analyzes aligned protein sequences.",
26 "All sequence numbers and position numbers start at 1.",
27 "Numbering is according to the input, including gaps.",
30 "-pair Align a pair of sequences (first two in input file).",
31 "-nogaps Strip gaps from input sequences.",
32 "-consolidategaps Remove positions in alignment with only gaps.",
33 "-identity Pairwise identity.",
34 "-similarity 0.5 Pairwise similarity: threshold for counting similar residues (default 0.5).",
35 "-profile Generate a profile from an alignment.",
36 "-information Information analysis.",
37 "-hydrophobicity 0.8 Hydrophobicity analysis: representation threshold (fraction of # of seqs).",
40 "-select 3,0.85 Select relative to a reference sequence and cutoff.",
41 "-length 128,435 Select sequences within a length range.",
42 "-delete Delete non-selected sequences.",
45 "-verbose 7 Verbosity of output.",
46 "-gap 10,0.2 Gap opening and extending penalties for alignment (default 20,0.2).",
47 "-segments 1-33,36-69 Selection of sequence segments (default all).",
48 " Every pair of numbers indicate a segment to select.",
49 "-sequences 2,18 Subset of sequences to compare (default all).",
50 "-window 17 Window for moving averages (default 20).",
53 "-properties file.star Property file (default = internal values).",
54 "-Similarity sim.star Residue similarity matrix (default blosum62.star).",
57 "-Matrix file.mat Matrix output filename.",
58 "-Image file.img Image output filename.",
59 "-Postscript file.ps Postscript output filename.",
64 int main(
int argc,
char **argv)
72 int consolidate_gaps(0);
82 long minlen(0), maxlen(0);
83 double gapopen(20), gapextend(0.2);
86 double sim_threshold(0.5);
87 double rep_threshold(0);
101 for ( curropt = option; curropt; curropt = curropt->
next ) {
102 if ( curropt->
tag ==
"pair" )
104 if ( curropt->
tag ==
"consolidategaps" )
105 consolidate_gaps = 1;
106 if ( curropt->
tag ==
"identity" )
108 if ( curropt->
tag ==
"similarity" ) {
109 if ( ( sim_threshold = curropt->
value.
real() ) < 0.01 )
110 cerr <<
"-similarity: A threshold must be specified!" << endl;
114 if ( curropt->
tag ==
"profile" )
116 if ( curropt->
tag ==
"information" )
118 if ( curropt->
tag ==
"hydrophobicity" ) {
119 if ( ( rep_threshold = curropt->
value.
real() ) < 0.001 )
120 cerr <<
"-hydrophobicity: A threshold must be specified!" << endl;
124 if ( curropt->
tag ==
"window" )
126 cerr <<
"-window: A window size must be specified!" << endl;
127 if ( curropt->
tag ==
"gap" ) {
128 if ( ( i = curropt->
values(gapopen, gapextend) ) < 1 )
129 cerr <<
"-gap: At least one gap penalty must be specified!" << endl;
133 if ( curropt->
tag ==
"nogaps" )
134 atom_select =
"NOGAP";
135 if ( curropt->
tag ==
"segments" ) {
136 segments = curropt->
value;
137 if ( segments.
length() < 1 )
138 cerr <<
"-segments: Numbers must be specified!" << endl;
140 if ( curropt->
tag ==
"sequences" ) {
141 if ( curropt->
values(sub1, sub2) < 2 )
142 cerr <<
"-sequences: Two numbers must be specified!" << endl;
144 if ( sub1 > 0 ) sub1--;
145 if ( sub2 > sub1 ) sub2--;
149 if ( curropt->
tag ==
"delete" ) delseq = 1;
150 if ( curropt->
tag ==
"select" )
151 if ( curropt->
values(ref, cutoff) < 2 )
152 cerr <<
"-select: Two numbers must be specified!" << endl;
153 if ( curropt->
tag ==
"length" )
154 if ( curropt->
values(minlen, maxlen) < 2 )
155 cerr <<
"-length: Two lengths must be specified!" << endl;
156 if ( curropt->
tag ==
"properties" )
158 if ( curropt->
tag ==
"Similarity" )
160 if ( curropt->
tag ==
"Matrix" )
162 if ( curropt->
tag ==
"Image" )
164 if ( curropt->
tag ==
"Postscript" )
172 Bstring filename(argv[optind++]);
175 cerr <<
"Error: No molecules read!" << endl;
182 char* profile = NULL;
185 if ( window < 2 ) window = 2;
186 if ( window > 1000 ) window = 1000;
190 for ( j=0; j<molgroup->
maxlen; j++ )
192 for ( i=0, mol = molgroup->
mol; mol; i++, mol = mol->
next ) {
193 if ( mol->
seq.
length() && i>=sub1 && i<=sub2 ) {
195 if ( mol->
seq[j] !=
'-' )
227 for ( i=0; i<molgroup->
maxlen; i++ )
231 cout <<
"Alignment positions flagged: " << j << endl << endl;
245 if ( maxlen )
seq_select(molgroup, minlen, maxlen);
247 if ( ref )
seq_select(molgroup, mat, ref, cutoff);
274 if ( profile )
delete[] profile;
A class for a command line input option.
int molgroup_kill(Bmolgroup *molgroup)
Destroys a molecule group.
int molecule_update_comment(Bmolgroup *molgroup, int n, char **strings)
Puts a set of strings and time in the main comment of a molecule group.
char * seq_aligned_profile(Bmolgroup *molgroup)
Generates a PROSITE format profile from an aligned set of sequences.
int bexit(int value)
Exit function for cleanup and debugging.
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
long seq_delete(Bmolgroup *molgroup, Matrix mat)
Deletes non-selected sequences and corresponding elelments of a comparison matrix.
Bmolgroup * read_molecule(const char *filename, const char *select, const char *paramfile)
The generalized function for reading molecular files.
Header file for option handlers.
Header file for reading residue property files.
long values(T1 &v1, T2 &v2)
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
Header file for functions to generate and analyze dot plots.
Matrix seq_aligned_similarity(Bmolgroup *molgroup, double threshold, Bresidue_matrix *simat)
Calculates the pairwise similarities between aligned sequences.
int seq_aligned_hydrophobicity(Bmolgroup *molgroup, int window, double threshold, Bstring &hphobfile, Bstring &psfile)
Calculates the average hydrophobicity at every position in an alignment.
General image parameter class.
Utilities for timing functions.
int main(int argc, char **argv)
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
Header file for sequence analysis functions.
int seq_aligned_information(Bmolgroup *molgroup, int window, Bstring &psfile)
Calculates the sequence logo representation for an alignment.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
int write_molecule(char *filename, Bmolgroup *molgroup)
Writes a molecule group.
Header file for 2D and 3D image I/O.
int molgroup_consolidate_gaps(Bmolgroup *molgroup)
Removes redundant gaps from an alignment.
int residue_matrix_kill(Bresidue_matrix *resmat)
Deallocating a residue matrix.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
void write(Bstring &filename)
long seq_select(Bmolgroup *molgroup, long minlen, long maxlen)
Selects sequences within a range of lengths.
long seq_pair_align(Bmolecule *mol1, Bmolecule *mol2, double gapopen, double gapextend, Bresidue_matrix *simat)
Aligns two sequences.
Matrix seq_aligned_identity(Bmolgroup *molgroup)
Calculates the pairwise identities between aligned sequences.
int select_numbers(Bstring &string, int n, int *numsel)
Converts a string with a selection specification into an integer array.
Bresidue_matrix * get_residue_matrix(Bstring &filename)
Reading a residue matrix from a file.
long statistics()
Calculates the statistics for an image.