sith.utils package

Submodules

Module contents

basics

[script] sith/utils/basics.sh

This script contains basics tools for other bash scripts. With the code in
here, you can use the next functions

- <first_argument> Add a label in every output of each bash script by giving
it as a first argument.
- <second_argument> ‘true’ in order to have verbose printing in the output.
Otherwise, your script will ignore all the verbose.
- adjust <text>: print the label with 4 + marks and <text> in an adjusted
column of 80 characters. The last line is completed with + marks until have
80 characters.
- adjust_text <text>: print what <text> in an adjusted column of 80 characters.
- verbose <text>: besides of the label, it adds the keyword VERBOSE in to the
begining of <text> and print the adjusted text.
- warning <text>: besides of the label, it adds the keyword WARNING in to the
begining of <text> and print the adjusted text.
- finish <text>: besides of the label, it use verbose to print <text> of the
word finish if <text> is not given. It also stops the script with ‘exit 0’
- fail <text>: besides of the label, it adds the keyword VERBOSE in to the
begining of <text> and print the adjusted text. It also print the message
in the std_error and stops the script with ‘exit 1’.
- create_bck [<name1> <name2> …]: function that moves an existing file or
directory to <basic_functions_name>-bck_[n][.ext] where n is the number of
the backup with 3 digits (leading zeros if necessary) and ext is
automatically extracted from the original file.
- search_last_bck <name>: finds the last [n] created by the function
create_bck.
- load_modules: loads the modules I need in my codes when running in a cluster.
- wait_until_next_file_exist <file_name>: literaly waits untils <file_name>
appears after executing ls. This is important for some file systems that
take a little while to recognize files created in a script.

clean_ds

[script] sith/utils/clean_ds.sh

This code checks the aminoacids in the ‘data runnig’ directory and evaluates
the state of the running (running, completed, failed). In case to be completed,
it is moved to the dataset directory.

-r running directory. default ./
-s data set directory. default ../random3
-u user. defatult sucerqdl

-v verbose.
-h prints this message.

find_blocks

[script] sith/utils/find_blocks.sh

This code extracts the sections in a file starting and finishing with specific
patterns without including the lines containing those patterns. Check the next
options:

-f <file> file that shows
-s <pattern> pattern that defines the beginning of the block. This line is
not included in the block.
-e <pattern> pattern that defines the end of the block. This line is not
included in the block.
-i use this flag if the start and the end are indexes
-o <output=’output’> ‘terminal’ or the name of the output without extension.
In the later case, the output will be stored in files called
<output>_<n>.dat, where n is the number of appearence of the block in the
file with 3-digits format (leading zeros); n starts in 001.

-v verbose of what’s the code doing.
-h prints this message.