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
import boto3 | |
from botocore.exceptions import ClientError | |
import requests | |
import getpass | |
import os | |
import time | |
username = input('Username:') | |
password = getpass.getpass() |
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
#!/bin/bash | |
MFF_DIRECTORY=$1 | |
for mffzip in "$MFF_DIRECTORY"*.mff.zip; do | |
echo "Renaming $mffzip directories to just ${mffzip%.zip}" | |
mv "$mffzip" "${mffzip%.zip}"; | |
done | |
for mff in *.mff; do |
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
#!/bin/bash | |
## NDA AWS Token Generator | |
## Author: NIMH Data Archives | |
## http://ndar.nih.gov | |
## License: MIT | |
## https://opensource.org/licenses/MIT | |
############################################################################## | |
# | |
# Script to retrieve generated AWS Tokens from NIMHDA |
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
#!/bin/bash | |
# Pass in s3 URL=$1 | |
# Set up Pathing | |
## Drop s3:// | |
pname=${1#*//} | |
## Drop Bucket Name, i.e., NDAR_Central*, NDAR_Results, etc. | |
pname=${pname#*/} | |
## Get text after last / | |
fname=${1##*/} |
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
echo $1 | |
# Use grep REGEX to extract portion of s3 URL to reuse as zip file name. | |
folder=`echo $1 | grep -Eio '\/([0-9]+)\/$' | grep -Eio '([0-9]+)'` | |
mkdir ./$folder | |
echo s3cmd get --recursive $1 ./$folder | |
s3cmd get --recursive $1 ./$folder | |
echo zip -r $folder ./$folder/* | |
zip -r $folder ./$folder/* | |
echo rm -rf ./$folder/ | |
rm -rf ./$folder/ |
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
use strict; | |
use warnings; | |
use Vcf; | |
my $filename = $ARGV[0]; | |
open ( my $handle, "<", $filename); | |
my $vcf = Vcf->new(fh=>$handle); | |
$vcf->parse_header(); | |
vcf_iterate(); |
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
#!/usr/bin/bash | |
# | |
# make_gz.sh | |
# | |
# Call this script with a list of s3 locations with VCF files to parse | |
# aws --profile NDAR s3 ls s3:/S3_URL/ | awk '{print $4}' | xargs -n1 -P4 sh make_gz.sh | |
# xargs -n1 -P4 accepts one argument and runs 4 parallel processes | |
# |
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
#GATK Method <- Slower and keeps original ID plut dbSNP rsID | |
# R=Reference FASTA | |
# V=VCF file to add IDs to | |
# --dbsnp = dbsnp VCF -- download from NCBI FTP | |
java -jar GenomeAnalysisTK.jar -R /reference/Homo_sapiens_assembly19.fasta -T VariantAnnotator -V vcf_to_add_id_to.vcf --dbsnp /reference/dbsnp_137.b37.vcf.gz --out /data/Broad.chr1.annotated.vcf | |
#bcftools Method <- Faster, replaces existing ID with dbSNP rsID | |
/usr/bin/htslib/bcftools/bcftools annotate -a /reference/dbsnp_137.b37.vcf.gz -c ID vcf_to_add_id_to.vcf |
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
/usr/bin/htslib/bcftools view -H vcf_with_bad_header.vcf > vcf_header.vcf | |
vim vcf_header.vcf | |
#Make changes to header | |
/usr/bin/htslib/bcftools/bcftools reheader -h vcf_header vcf_with_bad_header.vcf -o reheadered.vcf |
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
/usr/bin/htslib/bcftools/bcftools view vcf_with_chr.vcf | sed "s/chr//g" | /usr/bin/htslib/htslib/bgzip -c > BCM_hg19.reheader.no_chr.vcf.gz |
NewerOlder