annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/replaceheaders.sh @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
rev   line source
jpayne@69 1 #!/bin/bash
jpayne@69 2
jpayne@69 3 usage(){
jpayne@69 4 echo "
jpayne@69 5 Written by Brian Bushnell
jpayne@69 6 Last modified May 23, 2016
jpayne@69 7
jpayne@69 8 Description: Replaces read names with names from another file.
jpayne@69 9 The other file can either be sequences or simply names, with
jpayne@69 10 one name per line (and no > or @ symbols). If you use one name
jpayne@69 11 per line, please give the file a .header extension.
jpayne@69 12
jpayne@69 13 Usage: replaceheaders.sh in=<file> hin=<headers file> out=<out file>
jpayne@69 14
jpayne@69 15 Parameters:
jpayne@69 16 in= Input sequences. Use in2 for a second paired file.
jpayne@69 17 in= Header input sequences. Use hin2 for a second paired file.
jpayne@69 18 out= Output sequences. Use out2 for a second paired file.
jpayne@69 19 ow=f (overwrite) Overwrites files that already exist.
jpayne@69 20 zl=4 (ziplevel) Set compression level, 1 (low) to 9 (max).
jpayne@69 21 int=f (interleaved) Determines whether INPUT file is considered interleaved.
jpayne@69 22 fastawrap=70 Length of lines in fasta output.
jpayne@69 23 qin=auto ASCII offset for input quality. May be 33 (Sanger), 64 (Illumina), or auto.
jpayne@69 24 qout=auto ASCII offset for output quality. May be 33 (Sanger), 64 (Illumina), or auto (same as input).
jpayne@69 25
jpayne@69 26 Renaming modes (if not default):
jpayne@69 27 addprefix=f Rename the read by prepending the new name to the existing name.
jpayne@69 28
jpayne@69 29 Sampling parameters:
jpayne@69 30 reads=-1 Set to a positive number to only process this many INPUT reads (or pairs), then quit.
jpayne@69 31
jpayne@69 32 Java Parameters:
jpayne@69 33 -Xmx This will set Java's memory usage, overriding autodetection.
jpayne@69 34 -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will specify 200 megs.
jpayne@69 35 The max is typically 85% of physical memory.
jpayne@69 36 -eoom This flag will cause the process to exit if an
jpayne@69 37 out-of-memory exception occurs. Requires Java 8u92+.
jpayne@69 38 -da Disable assertions.
jpayne@69 39
jpayne@69 40 Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems.
jpayne@69 41 "
jpayne@69 42 }
jpayne@69 43
jpayne@69 44 #This block allows symlinked shellscripts to correctly set classpath.
jpayne@69 45 pushd . > /dev/null
jpayne@69 46 DIR="${BASH_SOURCE[0]}"
jpayne@69 47 while [ -h "$DIR" ]; do
jpayne@69 48 cd "$(dirname "$DIR")"
jpayne@69 49 DIR="$(readlink "$(basename "$DIR")")"
jpayne@69 50 done
jpayne@69 51 cd "$(dirname "$DIR")"
jpayne@69 52 DIR="$(pwd)/"
jpayne@69 53 popd > /dev/null
jpayne@69 54
jpayne@69 55 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
jpayne@69 56 CP="$DIR""current/"
jpayne@69 57
jpayne@69 58 z="-Xmx1g"
jpayne@69 59 set=0
jpayne@69 60
jpayne@69 61 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
jpayne@69 62 usage
jpayne@69 63 exit
jpayne@69 64 fi
jpayne@69 65
jpayne@69 66 calcXmx () {
jpayne@69 67 source "$DIR""/calcmem.sh"
jpayne@69 68 setEnvironment
jpayne@69 69 parseXmx "$@"
jpayne@69 70 }
jpayne@69 71 calcXmx "$@"
jpayne@69 72
jpayne@69 73 function reheader() {
jpayne@69 74 local CMD="java $EA $EOOM $z -cp $CP jgi.ReplaceHeaders $@"
jpayne@69 75 echo $CMD >&2
jpayne@69 76 eval $CMD
jpayne@69 77 }
jpayne@69 78
jpayne@69 79 reheader "$@"