-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- removed the deprecated bit-median-ratio-norm, as that is encompassed in bit-normalize-table - removed the stub-bit-GTDB-tax-to-NCBI-tax as that type of path is no longer needed, it is probably better to do a different quick taxonomy assignment method to NCBI, like with sourmash or other
- Loading branch information
1 parent
e37af9a
commit bfa19de
Showing
4 changed files
with
92 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#!/usr/bin/env python | ||
|
||
""" | ||
This is a program for downloading test data files. | ||
""" | ||
|
||
import sys | ||
import os | ||
import argparse | ||
import textwrap | ||
|
||
parser = argparse.ArgumentParser(description = "This is a helper program for downloading test data for use with bit workflows and programs. For bit verison info run `bit-version`. ", | ||
epilog="Ex. usage: bit-get-test-data metagenomics\n") | ||
|
||
required = parser.add_argument_group('required arguments') | ||
|
||
required.add_argument('datatype', choices = ['metagenomics'], | ||
help = "The first positional argument should be what type of test data you'd like to download") | ||
|
||
if len(sys.argv)==1: | ||
parser.print_help(sys.stderr) | ||
sys.exit(0) | ||
|
||
args = parser.parse_args() | ||
|
||
|
||
################################################################################ | ||
|
||
def main(): | ||
|
||
dl_test_data() | ||
|
||
################################################################################ | ||
|
||
### variables and functions ### | ||
|
||
tty_colors = { | ||
'green' : '\033[0;32m%s\033[0m', | ||
'yellow' : '\033[0;33m%s\033[0m', | ||
'red' : '\033[0;31m%s\033[0m' | ||
} | ||
|
||
def color_text(text, color='green'): | ||
if sys.stdout.isatty(): | ||
return tty_colors[color] % text | ||
else: | ||
return text | ||
|
||
|
||
def wprint(text): | ||
print(textwrap.fill(text, width=80, initial_indent=" ", | ||
subsequent_indent=" ", break_on_hyphens=False)) | ||
|
||
|
||
def report_message(message, color = "yellow"): | ||
print("") | ||
wprint(color_text(message, color)) | ||
|
||
|
||
def dl_test_data(): | ||
|
||
""" main function for downloading test data """ | ||
|
||
if args.datatype == "metagenomics": | ||
|
||
report_message("Downloading and unpacking 2 paired-end Illumina metagenomics test samples (4 files, ~800 MB total; they are kinda large for test data so MAGs can be recovered):") | ||
print("") | ||
|
||
# getting the metagenomics test data | ||
os.system("curl -L -o test-metagenomics-reads.zip https://figshare.com/ndownloader/files/46096083") | ||
|
||
# extracting | ||
os.system("unzip -qo test-metagenomics-reads.zip") | ||
|
||
# removing archive | ||
os.system("rm test-metagenomics-reads.zip") | ||
|
||
report_message("Pulled metagenomics (Illumina) reads for two test samples from here:", "green") | ||
print(" https://figshare.com/account/projects/203736/articles/25750935\n") | ||
|
||
else: | ||
|
||
report_message("The data type you requested is not currently available.", "red") | ||
|
||
print("\n Please check the currently available data types with 'bit-get-test-data --help'\n") | ||
|
||
|
||
################################################################################ | ||
|
||
if __name__ == "__main__": | ||
main() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
version='1.9.0' | ||
version='1.9.1' | ||
|
||
GREEN='\033[0;32m' | ||
NC='\033[0m' | ||
|
This file was deleted.
Oops, something went wrong.