#Formatting Go code
- go fmt
- go vet
- golint
#Package manager options
- gb
- go get
- git clone
#Formatting Go code
#Package manager options
#Gist of the gist This is a simple example showing how htslib can be used to parse VCF/BCF files in C++. Compiling options are shown in compile_and_run.sh, this assumes that you have compiled htslib into a static library - libhts.a, post a comment if you'd like help doing that.
The program takes a VCF file and spits out chromosome, position and number_of_alleles for each record in the VCF.
This test in the Samtools repo - [https://github.com/samtools/htslib/blob/1.2.1/test/test-vcf-api.c] also has some useful examples, note you might have to switch to the master branch version of that file to keep up with the currently rapidly evolving htslib API.
#Acknowledgements
| http://vim.wikia.com/wiki/Converting_tabs_to_spaces | |
| To switch to Tabs from Spaces | |
| :set noexpandtab | |
| Switch to spaces | |
| :set expandtab | |
| :set tabstop=4 |
| #include <stdint.h> | |
| #include <cstdlib> | |
| #include <iostream> | |
| #include <fstream> | |
| #include <sstream> | |
| using namespace std; | |
| void usage() { | |
| cerr << "Usage: ./get_count_with_sufficient_coverage samtools_depth_file cutoff[INT]"; | |
| cerr << "Assumes 2 samples."; |
| sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName |
| include_directories(../src/mash/capnp/) | |
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
| set(CMAKE_MODULE_PATH | |
| ".;${CMAKE_MODULE_PATH}") | |
| find_package(CapnProto REQUIRED) | |
| include_directories(${CAPNP_INCLUDE_DIRS}) | |
| add_definitions(${CAPNP_DEFINITIONS}) | |
| capnp_generate_cpp(CAPNP_SRCS CAPNP_HDRS MinHash.capnp) |
| awk '{ gsub("\,", "");gsub("\"", ""); gsub ("\r", "\n"); print }' SupplementaryData1_Tier1_SNVs.txt | awk 'BEGIN { print "##fileformat=VCFv4.1\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO" } !/Chrom/ { if($1 !~ /GL/) print $1"\t"$2"\t.\t"$4"\t"$5"\t.\tPASS\t." }' > hcc1395_somatic.vcf |
Essential cell biology / Bruce Alberts [and others].
Coming to Life: How Genes Drive Development by Christiane Nüsslein-Volhard
| sudo apt-get install git | |
| sudo apt-get install cmake | |
| sudo apt-get update | |
| sudo apt-get install zlib1g-dev | |
| sudo apt-get install g++ | |
| cd /home && mkdir src && cd src | |
| git clone https://github.com/griffithlab/regtools | |
| cd regtools && mkdir build && cd build | |
| cmake .. && make | |
| cp regtools /usr/local/bin/ |
| set expandtab #convert tabs to spaces | |
| set noexpandtab #don't convert tabs to spaces |