Debian Codegraph @

filterassemblysummary.sh

raw symbols SCIP
1 #!/bin/bash
2
3 usage(){
4 echo "
5 Written by Brian Bushnell
6 Last modified May 18, 2016
7
8 Description: Filters NCBI assembly summaries according to their taxonomy.
9 The specific files are available here:
10
11 ftp://ftp.ncbi.nlm.nih.gov/genomes/ASSEMBLY_REPORTS/assembly_summary_genbank.txt
12 or ftp://ftp.ncbi.nlm.nih.gov/genomes/genbank/assembly_summary_genbank.txt
13 ftp://ftp.ncbi.nlm.nih.gov/genomes/ASSEMBLY_REPORTS/assembly_summary_refseq.txt
14 or ftp://ftp.ncbi.nlm.nih.gov/genomes/refseq/assembly_summary_refseq.txt
15
16 Usage: filterassemblysummary.sh in=<input file> out=<output file> tree=<tree file> table=<table file> ids=<numbers> level=<name or number>
17
18 Standard parameters:
19 in=<file> Primary input.
20 out=<file> Primary output.
21 overwrite=f (ow) Set to false to force the program to abort rather than
22 overwrite an existing file.
23
24 Processing parameters:
25 level= Taxonomic level, such as phylum. Filtering will operate on
26 sequences within the same taxonomic level as specified ids.
27 reqlevel= Require nodes to have ancestors at these levels. For example,
28 reqlevel=species,genus would ban nodes that are not defined
29 at both the species and genus levels.
30 ids= Comma-delimited list of NCBI numeric IDs.
31 names= Alternately, a list of names (such as 'Homo sapiens').
32 Note that spaces need special handling.
33 include=f 'f' will discard filtered sequences, 't' will keep them.
34 tree= A taxonomic tree made by TaxTree, such as tree.taxtree.gz.
35 table= A table translating gi numbers to NCBI taxIDs.
36 Only needed if gi numbers will be used.
37 * Note *
38 Tree and table files are in /global/projectb/sandbox/gaag/bbtools/tax
39 For non-Genepool users, or to make new ones, use taxtree.sh and gitable.sh
40
41 Java Parameters:
42 -Xmx This will set Java's memory usage, overriding autodetection.
43 -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will
44 specify 200 megs. The max is typically 85% of physical memory.
45 -eoom This flag will cause the process to exit if an out-of-memory
46 exception occurs. Requires Java 8u92+.
47 -da Disable assertions.
48
49 Please contact Brian Bushnell at [email protected] if you encounter any problems.
50 "
51 }
52
53 #This block allows symlinked shellscripts to correctly set classpath.
54 pushd . > /dev/null
55 DIR="${BASH_SOURCE[0]}"
56 while [ -h "$DIR" ]; do
57 cd "$(dirname "$DIR")"
58 DIR="$(readlink "$(basename "$DIR")")"
59 done
60 cd "$(dirname "$DIR")"
61 DIR="$(pwd)/"
62 popd > /dev/null
63
64 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
65 CP="$DIR""current/"
66
67 z="-Xmx4g"
68 z2="-Xms4g"
69 set=0
70
71 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
72 usage
73 exit
74 fi
75
76 calcXmx () {
77 source "$DIR""/calcmem.sh"
78 setEnvironment
79 parseXmx "$@"
80 if [[ $set == 1 ]]; then
81 return
82 fi
83 freeRam 1000m 84
84 z="-Xmx${RAM}m"
85 z2="-Xms${RAM}m"
86 }
87 calcXmx "$@"
88
89 filterassemblysummary() {
90 local CMD="java $EA $EOOM $z -cp $CP driver.FilterAssemblySummary $@"
91 echo $CMD >&2
92 eval $CMD
93 }
94
95 filterassemblysummary "$@"