Skip to content

Instantly share code, notes, and snippets.

View mdshw5's full-sized avatar

Matt Shirley mdshw5

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<Test-sra>
<Version>
NCBI SRA Toolkit release version: 2.4.3.<br/>
Latest available NCBI SRA Toolkit release version: 2.4.3.<br/>
You already have the latest version of SRA Toolkit.
</Version>
<Os>Darwin LT-SHIRLEYM.local 14.1.0 Darwin Kernel Version 14.1.0: Mon Dec 22 23:10:38 PST 2014; root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64</Os>
<Ascp>
ascp_locate = RC(rcNS,rcFile,rcCopying,rcFile,rcNotFound)
<MaxRate>300m</MaxRate>
@mdshw5
mdshw5 / 126118.sh
Last active August 29, 2015 14:13
biostars 126118
curl -s ftp://ftp.ncbi.nlm.nih.gov//genbank/genomes/Eukaryotes/vertebrates_mammals/Homo_sapiens/GRCh38/seqs_for_alignment_pipelines/GCA_000001405.15_GRCh38_full_analysis_set.fna.gz \
| gunzip | grep '[WK]'
@mdshw5
mdshw5 / 125610.fa
Created January 5, 2015 15:44
biostars 125610
>c1042
ACCGTACCC
>c1043
GCTACAGTTGAAAGGGGACCGTACCC
>c1044
ATGAATAAAATAATTTTGTATCATAAATCGAGCTGTTAATTATT
>c1045
TTCATATTTGTAGCTAAGCAGAGGCGAAGCGTTCTTGTATCG
@mdshw5
mdshw5 / 123787.py
Created December 14, 2014 20:36
biostars 123787
from pyfaidx import Fasta
ids = [1, 5, 10]
multifasta = Fasta('multifasta.fa')
records = [multifasta[i] for i in ids]
for record in records:
# do something with the fasta entries such as...
print(record.seq)
@mdshw5
mdshw5 / prependcol
Created November 10, 2014 18:47
prependcol for vcfroc
#!/bin/sh
colname=${1}"\t";
colval=${2}"\t";
awk -v colname="$colname" -v colval="$colval" '{ if ($1 == "threshold") { printf(colname); print } else { printf(colval); print }}' "$3"
@mdshw5
mdshw5 / readings.py
Last active August 29, 2015 14:07
Assessment: Command-Line Programs
import sys
import numpy
def main():
script=sys.argv[0]
action=sys.argv[1]
filenames=sys.argv[2:]
assert action in ['--min", '--mean','--max'],\
Action is not one of --min, --mean, or --max: ' + action
@mdshw5
mdshw5 / mean_of_list_of_ints
Created October 1, 2014 18:37
assessment: python function definition
%% mean_of_list_of_ints(%%):
assert isinstance(%%, l)
assert all([type(n) is %% for n in l])
length = len(l)
mean = sum(l) / length
%% mean
@mdshw5
mdshw5 / fragment.py
Created September 10, 2014 00:05
huh?
def get_alignment(line):
col = line.split('\t')
if sam_format:
if line[0] == '@': return []
flag = col[1]
if 'u' in flag: return []
if options.unique and 's' in flag: return []
if options.pair and 'P' not in flag: return []
@mdshw5
mdshw5 / freec2bedgraph.py
Last active August 29, 2015 14:05
convert FREEC ratio.txt file to bedGraph format
"""
Chromosome Start Ratio MedianRatio CopyNumber
1 1 -1 -1 5
1 9854 4.28786 2.74942 5
1 19707 3.38082 2.74942 5
1 29560 2.56094 2.74942 5
1 39413 2.87198 2.74942 5
1 49266 2.47 2.74942 5
1 59119 2.62686 2.74942 5
1 68972 2.0109 1.81246 4