Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions biotiger/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,40 +139,40 @@ def gen_prefix(input):
return o

def die_with_help():
print """
****************
TIGER v2.0 Help:
****************

tiger index Options:

-i|input Specify input file. File must be in FastA format and must be aligned prior.
Datasets with uneven sequence lengths will return an error.

-s|split Split dataset across multiple files to run simultaneously. Takes int argument.

-o|output Specify the prefix name of output files.

-u|unknowns Specify unknown characters in the alignment. Unknown characters are omitted from
site patterns and so are not considered in the analysis.
-u ?,-,*: defines ?, - and * as unknown characters. (*Be sure to put only a comma
between characters, NO SPACE!!)

Default is ? only

Examples:
1. Generate a .tgr file for complete sequence named full_seq.tgr & set unknowns to ? and - :
tiger index -i my_file.aln -o full_seq -u ?,-

2. Generate 10 subsets of the data with an output prefix of tiger_split and a reference:
tiger index -i my_file.aln -o tiger_split -s 10
** Results in files named tiger_split.1.tgr, tiger_split.2,tgr, and so on, along with
tiger_split.ref.tgr

"""
print("""
****************
TIGER v2.0 Help:
****************
tiger index Options:
-i|input Specify input file. File must be in FastA format and must be aligned prior.
Datasets with uneven sequence lengths will return an error.
-s|split Split dataset across multiple files to run simultaneously. Takes int argument.
-o|output Specify the prefix name of output files.
-u|unknowns Specify unknown characters in the alignment. Unknown characters are omitted from
site patterns and so are not considered in the analysis.
-u ?,-,*: defines ?, - and * as unknown characters. (*Be sure to put only a comma
between characters, NO SPACE!!)
Default is ? only
Examples:
1. Generate a .tgr file for complete sequence named full_seq.tgr & set unknowns to ? and - :
tiger index -i my_file.aln -o full_seq -u ?,-
2. Generate 10 subsets of the data with an output prefix of tiger_split and a reference:
tiger index -i my_file.aln -o tiger_split -s 10
** Results in files named tiger_split.1.tgr, tiger_split.2,tgr, and so on, along with
tiger_split.ref.tgr
""")
sys.exit(1)

def die_with_message(message):
print message
print(message)
sys.exit(1)

90 changes: 45 additions & 45 deletions biotiger/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,56 +295,56 @@ def run(opts):
except IOError:
die_with_message("Cannot open outfile %s%s" % (opts.output, suffix))
else:
print output_str
print(output_str)


def die_with_help():
print """
****************
TIGER v2.0 Help:
****************

tiger output Options:
print("""
****************
TIGER v2.0 Help:
****************

-i|input Specify input file. Must be in .gr format.

-c|combine Specify input file. This file should contain a list of .gr files to be combined.

-fa|fasta Provide original .fa file for sequence data.

-o|output Specify prefix name for output files (prints to stdout if not provided)

-f|format Changes formatting options.
NEXUS, with comments:
-f 0: output bin numbers, sites unsorted (default)
-f 1: output bin number, sites sorted on rank
-f 2: displays rank values rather than bin numbers
-f 3: displays rank values and sites sorted on rank
FastA:
-f 4

-inc|include_only Give list of bins to include (only) in output
-inc 3,4,5,6 (Note: No spaces, just commas)

-exc|exclude_only Give list of bins to exclude from output
-exc 1,2,9,10

-m|mask Mask -inc/-exc sites. (Default is to remove them)

-b|bins Set the number of bins to be used.
-b <int>: Sites will be placed into <int> number of bins. <int> is a whole number.

Default is 10.
Examples:
1. Write a FastA file, masking site that fall into Bin1, Bin2, Bin9 and Bin10 of 10 bins:
tiger output -i sample.gr -fa my_data.fa -f 4 -exc 1,2,9,10 -b 10 --mask

2. Write a NEXUS file combining test.0.gr, test.1.gr, test.2.gr with sites sorted on rank
tiger output -c list_of_gr_files.txt -fa my_data.fa -f 3

"""
tiger output Options:

-i|input Specify input file. Must be in .gr format.

-c|combine Specify input file. This file should contain a list of .gr files to be combined.

-fa|fasta Provide original .fa file for sequence data.

-o|output Specify prefix name for output files (prints to stdout if not provided)

-f|format Changes formatting options.
NEXUS, with comments:
-f 0: output bin numbers, sites unsorted (default)
-f 1: output bin number, sites sorted on rank
-f 2: displays rank values rather than bin numbers
-f 3: displays rank values and sites sorted on rank
FastA:
-f 4

-inc|include_only Give list of bins to include (only) in output
-inc 3,4,5,6 (Note: No spaces, just commas)

-exc|exclude_only Give list of bins to exclude from output
-exc 1,2,9,10

-m|mask Mask -inc/-exc sites. (Default is to remove them)

-b|bins Set the number of bins to be used.
-b <int>: Sites will be placed into <int> number of bins. <int> is a whole number.

Default is 10.
Examples:
1. Write a FastA file, masking site that fall into Bin1, Bin2, Bin9 and Bin10 of 10 bins:
tiger output -i sample.gr -fa my_data.fa -f 4 -exc 1,2,9,10 -b 10 --mask

2. Write a NEXUS file combining test.0.gr, test.1.gr, test.2.gr with sites sorted on rank
tiger output -c list_of_gr_files.txt -fa my_data.fa -f 3

""")
sys.exit(1)

def die_with_message(message):
print message
print(message)
sys.exit(1)
84 changes: 42 additions & 42 deletions biotiger/rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def set_pattern(p):

def sort(rates, patterns):
if len(rates) != len(patterns):
print "Something's weird here. len(rates) != len(patterns)"
print("Something's weird here. len(rates) != len(patterns)")
sys.exit(1)

rate_d = {}
Expand Down Expand Up @@ -160,51 +160,51 @@ def gen_prefix(input):
return o

def die_with_help():
print """
****************
TIGER v2.0 Help:
****************

tiger rate Options:

-i|input Specify input file. File should be in .ti format.

-r|reference Specify reference sequence (.ti). -i file is used as default if none is provided.

-o|output Specify prefix name for output files.
print("""
****************
TIGER v2.0 Help:
****************

-rl|rate_list A list of the rate at each site may be optionally written to a specified
file.
-rl <file.txt> : writes list of the rates at each site to file.txt.

-ptp Specifies that a PTP test should be run.
* Note * this option has a huge effect on running time!

-z|randomisations Number of randomisations to be used for the PTP test.
-z <int>: each site will be randomised <int> times. <int> is a whole number.

Default is 100

-p|p_value Specify p-value which denotes significance in PTP test.
-p <float>: site will be denoted as significant if p-value is better than <float>.
<float> is a floating point number.

Default is 0.05

-pl|pval_list Write a list of p-values to a specified file.
-pl <file.txt>: writes list of p-values for each site to file.txt.

Examples:
1. Calculate rates for file test.ref.ti against itself, with a list of rates:
tiger rate -i test.ref.ti -rl
2. Calculate rates for file test.0.ti against test.ref.ti with a PTP test and a list of p values
tiger rate -i test.0.ti -r test.ref.ti -ptp -pl

"""
tiger rate Options:

-i|input Specify input file. File should be in .ti format.

-r|reference Specify reference sequence (.ti). -i file is used as default if none is provided.

-o|output Specify prefix name for output files.

-rl|rate_list A list of the rate at each site may be optionally written to a specified
file.
-rl <file.txt> : writes list of the rates at each site to file.txt.

-ptp Specifies that a PTP test should be run.
* Note * this option has a huge effect on running time!

-z|randomisations Number of randomisations to be used for the PTP test.
-z <int>: each site will be randomised <int> times. <int> is a whole number.

Default is 100

-p|p_value Specify p-value which denotes significance in PTP test.
-p <float>: site will be denoted as significant if p-value is better than <float>.
<float> is a floating point number.

Default is 0.05

-pl|pval_list Write a list of p-values to a specified file.
-pl <file.txt>: writes list of p-values for each site to file.txt.

Examples:
1. Calculate rates for file test.ref.ti against itself, with a list of rates:
tiger rate -i test.ref.ti -rl
2. Calculate rates for file test.0.ti against test.ref.ti with a PTP test and a list of p values
tiger rate -i test.0.ti -r test.ref.ti -ptp -pl

""")
sys.exit(1)

def die_with_message(message):
print message
print(message)
sys.exit(1)


Expand Down
Loading