Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.o
bin/
obj/
sandbox/
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,46 @@
# switchError
Compute switch error rates

This code was written by Olivier Delaneau with build environment and documentation contributions from Arjun Biddanda.

## Building the executable

The environment to build the software can be conducted by `conda env create -f env.yaml`. You can then subsequently run `conda activate switchError` and `make`, which should build the executable for you in `bin/switchError`.

## Input File Definitions

* "--gen": BCF formatted file of genotyped individuals [required]
* "--hap": BCF formatted file of individuals with estimated haplotypes [required]
* "--fam": PLINK formatted FAM file for evaluating IDs
* "--reg": BED-formatted region string for evaluating switch error rates [required]
* "--ps": Phase set information (more information [here](http://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html#readaware))
* "--out": output prefix, the outputfiles have extensions `*.iser`, `*.vser`,`*.mser.gz` [required]
* "--maf": minor allele frequency cutoff

## Output File Definitions

1. `*.iser`

The columns in order are:
* individual index
* individual name
* number of mendel errors
* number of opportunities for mendel errors
* number of typing errors
* number of opportunities for typing errors
* number of switch errors
* number of opportunities for switch errors

2. `*.vser`
* variant-level index
* position of variant
* minor allele count
* minor allele frequency
* number of mendel errors
* number of opportunities for mendel errors
* number of typing errors
* number of opportunities for typing errors
* number of switch errors
* number of opportunities for switch errors

Across both settings, we largely want to look at how to use the last two columns and their distribution across individuals.
Empty file added bin/placeholder.txt
Empty file.
Binary file removed bin/swithError
Binary file not shown.
16 changes: 16 additions & 0 deletions env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: switchError
channels:
- conda-forge
- bioconda
- hcc
dependencies:
- gxx
- libstdcxx-ng
- boost=1.75.0
- automake
- cmake
- htslib
- r-mathlib
- libzlib
- git

40 changes: 10 additions & 30 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
##########################################
# SET CORRECTLY THESE 6 PATHS TO COMPILE #
##########################################
BOOST_INC=
BOOST_LIB=
RMATH_INC=
RMATH_LIB=
HTSLD_INC=
HTSLD_LIB=
BOOST_INC=$(CONDA_PREFIX)/include
BOOST_LIB=$(CONDA_PREFIX)/lib
RMATH_INC=$(CONDA_PREFIX)/include
RMATH_LIB=$(CONDA_PREFIX)/lib
HTSLD_INC=$(CONDA_PREFIX)/include
HTSLD_LIB=$(CONDA_PREFIX)/lib

#COMPILER MODE C++11
CXX=g++ -std=c++0x
Expand All @@ -17,46 +17,26 @@ CXXFLAG_DBG=-g
CXXFLAG_WRN=-Wall -Wextra -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated -Wno-unused-parameter

#BASE LIBRARIES
LIB_FLAGS=-lz -lbz2 -lm -lpthread -llzma
LIB_FLAGS=-lz -lbz2 -lm -lpthread -llzma

#FILE LISTS
BFILE=bin/swithError
BFILE=bin/switchError
HFILE=$(shell find src -name *.h)
TFILE=$(shell find lib -name *.h)
CFILE=$(shell find src -name *.cpp)
OFILE=$(shell for file in `find src -name *.cpp`; do echo obj/$$(basename $$file .cpp).o; done)
VPATH=$(shell for file in `find src -name *.cpp`; do echo $$(dirname $$file); done)

#DEFAULT VERSION (I.E. UNIGE DESKTOP RELEASE VERSION)
#DEFAULT VERSION
all: desktop

#UNIGE DESKTOP RELEASE VERSION
desktop: RMATH_INC=$(HOME)/Tools/R-3.5.1/src/include
desktop: RMATH_LIB=$(HOME)/Tools/R-3.5.1/src/nmath/standalone
desktop: HTSLD_INC=$(HOME)/Tools/htslib-1.9
desktop: HTSLD_LIB=$(HOME)/Tools/htslib-1.9
desktop: BOOST_INC=/usr/include
desktop: BOOST_LIB=/usr/lib/x86_64-linux-gnu
desktop: CXXFLAG=$(CXXFLAG_REL) $(CXXFLAG_WRN)
desktop: IFLAG=-Ilib/OTools -Ilib -I$(RMATH_INC) -I$(HTSLD_INC) -I$(BOOST_INC)
desktop: LIB_FILES=$(RMATH_LIB)/libRmath.a $(HTSLD_LIB)/libhts.a $(BOOST_LIB)/libboost_iostreams.a $(BOOST_LIB)/libboost_program_options.a
desktop: LIB_FILES=-L$(RMATH_LIB)/ -lRmath -lboost_iostreams -lboost_program_options -lhts
desktop: LDFLAG=$(CXXFLAG_REL)
desktop: $(BFILE)

#UNIL SERVER RELEASE VERSION
dcb2: LIB_FLAGS=-lz -lbz2 -lm -lpthread -lcurl -lcrypto -lssl -llzma
dcb2: RMATH_INC=/software/R/3.4.2/include
dcb2: RMATH_LIB=/software/R/3.4.2/lib64
dcb2: HTSLD_INC=/home/oldelan/lib/htslib-1.7
dcb2: HTSLD_LIB=/home/oldelan/lib/htslib-1.7
dcb2: BOOST_INC=/software/include
dcb2: BOOST_LIB=/software/lib64
dcb2: CXXFLAG=$(CXXFLAG_REL)
dcb2: IFLAG=-Ilib -Ilib/OTools -I$(HTSLD_INC) -I$(BOOST_INC) -I$(RMATH_INC)
dcb2: LIB_FILES=$(HTSLD_LIB)/libhts.a $(BOOST_LIB)/libboost_iostreams.a $(BOOST_LIB)/libboost_program_options.a
dcb2: LDFLAG=$(CXXFLAG_REL)
dcb2: $(BFILE)


#COMPILATION RULES
$(BFILE): $(OFILE)
Expand Down
Binary file removed obj/data_base.o
Binary file not shown.
Binary file removed obj/data_mendel.o
Binary file not shown.
Binary file removed obj/data_read.o
Binary file not shown.
Binary file removed obj/data_switch.o
Binary file not shown.
Binary file removed obj/data_write.o
Binary file not shown.
Empty file added obj/placeholder.txt
Empty file.
Binary file removed obj/switchError.o
Binary file not shown.
2 changes: 1 addition & 1 deletion src/data_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void data::readPedigrees(string fped) {
switch (type) {
case 2: n_tri ++; break;
case 1: n_duo ++; break;
default: n_tri ++; break;
default: n_unr ++; break;
}
}
}
Expand Down