Command | Meaning |
---|---|
echo -en "\rSomeText" |
Return carriage to the beginning of the line (-e and \r ), write "SomeText" at that point in time. Do not output a new line at the end of the statement (-n ). Useful for dynamic terminal messages. |
find . -exec touch -am {} \; |
Update the access and modified times for all files in this current directory and all subdirectories. Useful for keeping files around when set to expire after a given amount of time. |
find . -name 'foo-exclude-me' -prune -o -name 'foo*' -print |
Find all files with foo* , ignoring foo-exlude-me |
This file contains hidden or 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
#!/bin/bash | |
set -euo pipefail | |
MY_FILE="$1" | |
declare -ax ARRAY=($(<"${MYFILE}")) |
This file contains hidden or 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
#!/bin/bash | |
set -e | |
set -o pipefail | |
# Check for dependent programs | |
if ! `command -v samtools > /dev/null 2> /dev/null`; then echo "Please install SAMTools and place in your PATH"; exit 1; fi # Do we have SAMTools installed? | |
if ! `command -v bcftools > /dev/null 2> /dev/null`; then echo "Please install BCFTools and place in your PATH"; exit 1; fi # Do we have BCFTools installed? | |
# Create a usage message |
This file contains hidden or 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
#!/bin/bash | |
# This script is designed to install Platypus on MSI | |
set -e | |
set -o pipefail | |
INSTALL_DIR=${1:-$(pwd)} | |
echo "Installing Platypus into ${INSTALL_DIR}..." >&2 |
This file contains hidden or 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
#!/bin/bash | |
set -e | |
set -o pipefail | |
# Extract regions from a BED file and format it for use with ANGSD and ANGSD-wrapper | |
function Usage() { | |
echo -e "\ | |
Usage: $(basename $0) BED_FILE NUMBER [OUTFILE] [SEED] \n\ |
Adapted from the National Park Service
Right Side | Meaning |
---|---|
A + B |
Main effects of A and B |
A:B |
Interaction of A with B |
This file contains hidden or 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
#!/bin/bash | |
# This script downloads and installs SAMTools | |
# The current version of SAMTools is v1.3 | |
set -e | |
set -o pipefail | |
# What versions of SAMTools are we downloading? | |
SAMTOOLS_VERSION="1.3" |
This file contains hidden or 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
#!/usr/bin/env python | |
import argparse | |
parser = argparse.ArgumentParser(add_help=True, description="A switch argument in Python") | |
parser.add_argument('-s', | |
'--switch', | |
help="The switch", | |
action='store_true', |
This file contains hidden or 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
#!/bin/bash | |
# A function that checks the extension of a file | |
function checkExtension() { | |
FILE="$1" | |
EXTENSION="$2" | |
if [[ "${FILE: -4}" == "${EXTENSION}" ]] | |
then | |
echo yes | |
return 0 |
This file contains hidden or 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
#!/bin/bash | |
set -e | |
set -o pipefail | |
########################################################################################################################### | |
######################################### Usage Information ######################################### | |
# This is a script to extract adapter sequences that use barcodes embedded in the names of files | |
# To use, add a list of samples to the SAMPLE_INFO field on line 34 | |
# This should look like: |