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
| __F_OUT__ = __F_IN__.sub(/(\.[^.]+$)|$/, '.out') |
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
| n = n ? n + 1 : 1 |
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
| # 1. Create the mount point | |
| mkdir share_name | |
| # 2. Mount the share | |
| mount_smbfs //username:password@server.name/share_name share_name/ | |
| # 3. Unmount the share | |
| umount share_name |
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
| tar -cvzf __OUTPUT__.tar.gz __INPUT__ |
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 | |
| myvcf="$1" | |
| # Print header | |
| bcftools view -h -O v "$myvcf" | |
| # Sort and remove duplicates per chromosome | |
| for i in {1..22} MT X Y | |
| do |
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
| for util in 'awk' 'ruby' 'python' 'faketool' | |
| do | |
| if [ -z $(which "$util" 2> /dev/null) ]; then | |
| echo "ERROR: $util is not in your \$PATH" >&2 | |
| exit 1 | |
| fi | |
| done |
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
| # Add user and user's full name and groups | |
| useradd -m -c '__FULL_NAME__' -g __PRIMARY_GROUP__ -G __SECONDARY_GROUPS__ __USERNAME__ | |
| # Set user's password | |
| passwd __USERNAME__ |
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 | |
| # Submit a job for each chromosome | |
| # Job logs will be named __JOB_NAME__.chr1.o, __JOB_NAME__.chr2.o, etc. | |
| for chr in {1..22} MT X Y | |
| do | |
| qsub -N __JOB_NAME__.chr$chr -v CHR=$chr qsub.sh | |
| done |
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
| ## | |
| # Sort a VCF | |
| # | |
| # Input: | |
| # vcf[.gz] or bcf[.gz] | |
| # Output: | |
| # vcf | |
| # | |
| # Example usage: | |
| # ./sort_vcf.sh my.[vcf|bcf][.gz] > my.sorted.vcf |
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
| bcftools norm -f ~/data/references/human_g1k_v37.fa -c s -m- -O v __INPUT__ | awk -F'\t' '$5 !~ ","' | bgzip -c > __OUTPUT__ |