keyword stringclasses 7
values | repo_name stringlengths 8 98 | file_path stringlengths 4 244 | file_extension stringclasses 29
values | file_size int64 0 84.1M | line_count int64 0 1.6M | content stringlengths 1 84.1M ⌀ | language stringclasses 14
values |
|---|---|---|---|---|---|---|---|
2D | mitenjain/nanopore | submodules/samtools-0.1.19/sam_header.h | .h | 1,597 | 49 | #ifndef __SAM_HEADER_H__
#define __SAM_HEADER_H__
#ifdef __cplusplus
extern "C" {
#endif
void *sam_header_parse2(const char *headerText);
void *sam_header_merge(int n, const void **dicts);
void sam_header_free(void *header);
char *sam_header_write(const void *headerDict); // returns a newly allocated string
... | Unknown |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bam_color.c | .c | 3,333 | 146 | #include <ctype.h>
#include "bam.h"
/*!
@abstract Get the color encoding the previous and current base
@param b pointer to an alignment
@param i The i-th position, 0-based
@return color
@discussion Returns 0 no color information is found.
*/
char bam_aux_getCSi(bam1_t *b, int i)
{
uint8_t... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/sam_view.c | .c | 14,887 | 442 | #include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <math.h>
#include <inttypes.h>
#include "sam_header.h"
#include "sam.h"
#include "faidx.h"
#include "kstring.h"
#include "khash.h"
KHASH_SET_INIT_STR(rg)
// When counting records instead of printing them,
// data passed to the bam_... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bam_stat.c | .c | 3,202 | 78 | #include <unistd.h>
#include <assert.h>
#include "bam.h"
typedef struct {
long long n_reads[2], n_mapped[2], n_pair_all[2], n_pair_map[2], n_pair_good[2];
long long n_sgltn[2], n_read1[2], n_read2[2];
long long n_dup[2];
long long n_diffchr[2], n_diffhigh[2];
} bam_flagstat_t;
#define flagstat_loop(s, c) do { ... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bam_aux.c | .c | 5,085 | 218 | #include <ctype.h>
#include "bam.h"
#include "khash.h"
typedef char *str_p;
KHASH_MAP_INIT_STR(s, int)
KHASH_MAP_INIT_STR(r2l, str_p)
void bam_aux_append(bam1_t *b, const char tag[2], char type, int len, uint8_t *data)
{
int ori_len = b->data_len;
b->data_len += 3 + len;
b->l_aux += 3 + len;
if (b->m_data < b->dat... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bedcov.c | .c | 3,143 | 128 | #include <zlib.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "kstring.h"
#include "bgzf.h"
#include "bam.h"
#include "kseq.h"
KSTREAM_INIT(gzFile, gzread, 16384)
typedef struct {
bamFile fp;
bam_iter_t iter;
int min_mapQ;
} aux_t;
static int read_bam... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/ksort.h | .h | 10,125 | 286 | /* The MIT License
Copyright (c) 2008 Genome Research Ltd (GRL).
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use... | Unknown |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/sam.h | .h | 2,688 | 100 | #ifndef BAM_SAM_H
#define BAM_SAM_H
#include "bam.h"
/*!
@header
This file provides higher level of I/O routines and unifies the APIs
for SAM and BAM formats. These APIs are more convenient and
recommended.
@copyright Genome Research Ltd.
*/
/*! @typedef
@abstract SAM/BAM file handler
@field type ... | Unknown |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/kstring.h | .h | 4,459 | 170 | /* The MIT License
Copyright (c) by Attractive Chaos <attractor@live.co.uk>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the r... | Unknown |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/kstring.c | .c | 5,388 | 213 | #include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdint.h>
#include "kstring.h"
int ksprintf(kstring_t *s, const char *fmt, ...)
{
va_list ap;
int l;
va_start(ap, fmt);
l = vsnprintf(s->s + s->l, s->m - s->l, fmt, ap); // This line does not work with glibc 2.0. See `man snpri... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bam_index.c | .c | 21,491 | 727 | #include <ctype.h>
#include <assert.h>
#include "bam.h"
#include "khash.h"
#include "ksort.h"
#include "bam_endian.h"
#ifdef _USE_KNETFILE
#include "knetfile.h"
#endif
/*!
@header
Alignment indexing. Before indexing, BAM must be sorted based on the
leftmost coordinate of alignments. In indexing, BAM uses two in... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bam_tview.c | .c | 11,391 | 369 | #include <assert.h>
#include "bam_tview.h"
int base_tv_init(tview_t* tv,const char *fn, const char *fn_fa, const char *samples)
{
assert(tv!=NULL);
assert(fn!=NULL);
tv->mrow = 24; tv->mcol = 80;
tv->color_for = TV_COLOR_MAPQ;
tv->is_dot = 1;
tv->fp = bam_open(fn, "r");
if(tv->fp==0)
{
fprintf(stderr,"ba... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/kaln.c | .c | 15,230 | 487 | /* The MIT License
Copyright (c) 2003-2006, 2008, 2009, by Heng Li <lh3lh3@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitat... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/kseq.h | .h | 8,811 | 236 | /* The MIT License
Copyright (c) 2008, 2009, 2011 Attractive Chaos <attractor@live.co.uk>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without lim... | Unknown |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/cut_target.c | .c | 5,667 | 194 | #include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include "bam.h"
#include "errmod.h"
#include "faidx.h"
#define ERR_DEP 0.83f
typedef struct {
int e[2][3], p[2][2];
} score_param_t;
/* Note that although the two matrics have 10 parameters in total, only 4
* (probably 3) are free. Changing the scoring ... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/klist.h | .h | 3,472 | 97 | #ifndef _LH3_KLIST_H
#define _LH3_KLIST_H
#include <stdlib.h>
#define KMEMPOOL_INIT(name, kmptype_t, kmpfree_f) \
typedef struct { \
size_t cnt, n, max; \
kmptype_t **buf; \
} kmp_##name##_t; \
static inline kmp_##name##_t *kmp_init_##name() { \
return c... | Unknown |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/phase.c | .c | 20,819 | 688 | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
#include <math.h>
#include <zlib.h>
#include "bam.h"
#include "errmod.h"
#include "kseq.h"
KSTREAM_INIT(gzFile, gzread, 16384)
#define MAX_VARS 256
#define FLIP_PENALTY 2
#define FLIP_THRES 4
#define MASK_THRES 3
#define FLAG_FIX_CHIMERA ... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bam.c | .c | 15,981 | 475 | #include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <assert.h>
#include "bam.h"
#include "bam_endian.h"
#include "kstring.h"
#include "sam_header.h"
int bam_is_be = 0, bam_verbose = 2, bam_no_B = 0;
char *bam_flag2char_table = "pPuUrR12sfd\0\0\0\0\0";
/**************************
* CIGAR related routine... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bgzf.c | .c | 21,127 | 695 | /* The MIT License
Copyright (c) 2008 Broad Institute / Massachusetts Institute of Technology
2011 Attractive Chaos <attractor@live.co.uk>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to dea... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/kprobaln.c | .c | 10,675 | 281 | /* The MIT License
Copyright (c) 2003-2006, 2008-2010, by Heng Li <lh3lh3@live.co.uk>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitat... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bgzf.h | .h | 6,326 | 208 | /* The MIT License
Copyright (c) 2008 Broad Institute / Massachusetts Institute of Technology
2011, 2012 Attractive Chaos <attractor@live.co.uk>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), ... | Unknown |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bam_tview_html.c | .c | 8,406 | 350 | #include <unistd.h>
#include "bam_tview.h"
#define UNDERLINE_FLAG 10
typedef struct HtmlTview {
tview_t view;
int row_count;
tixel_t** screen;
FILE* out;
int attributes;/* color... */
} html_tview_t;
#define FROM_TV(ptr) ((html_tview_t*)ptr)
static void html_destroy(tview_t* base)
{
int i;
html_tview_t* tv... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/index.c | .c | 8,256 | 337 | #include <assert.h>
#include <ctype.h>
#include <sys/stat.h>
#include "bam_endian.h"
#include "kstring.h"
#include "bcf.h"
#ifdef _USE_KNETFILE
#include "knetfile.h"
#endif
#define TAD_LIDX_SHIFT 13
typedef struct {
int32_t n, m;
uint64_t *offset;
} bcf_lidx_t;
struct __bcf_idx_t {
int32_t n;
bcf_lidx_t *index2;... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/main.c | .c | 5,184 | 192 | #include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include "knetfile.h"
#include "bcf.h"
#include "kseq.h"
KSTREAM_INIT(gzFile, gzread, 0x10000)
int bcfview(int argc, char *argv[]);
int bcf_main_index(int argc, char *argv[]);
#define BUF_SIZE 0x10000
int bcf_cat(int n, char * const *... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/em.c | .c | 8,985 | 311 | #include <stdlib.h>
#include <string.h>
#include <math.h>
#include "bcf.h"
#include "kmin.h"
static double g_q2p[256];
#define ITER_MAX 50
#define ITER_TRY 10
#define EPS 1e-5
extern double kf_gammaq(double, double);
/*
Generic routines
*/
// get the 3 genotype likelihoods
static double *get_pdg3(const bcf1_t *b)... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/call1.c | .c | 26,288 | 634 | #include <unistd.h>
#include <stdlib.h>
#include <math.h>
#include <zlib.h>
#include <errno.h>
#include "bcf.h"
#include "prob1.h"
#include "kstring.h"
#include "time.h"
#ifdef _WIN32
#define srand48(x) srand(x)
#define lrand48() rand()
#endif
#include "kseq.h"
KSTREAM_INIT(gzFile, gzread, 16384)
#define VC_NO_GENO ... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/mut.c | .c | 3,816 | 128 | #include <stdlib.h>
#include <stdint.h>
#include "bcf.h"
#define MAX_GENO 359
int8_t seq_bitcnt[] = { 4, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 };
char *seq_nt16rev = "XACMGRSVTWYHKDBN";
uint32_t *bcf_trio_prep(int is_x, int is_son)
{
int i, j, k, n, map[10];
uint32_t *ret;
ret = calloc(MAX_GENO, 4);
for (i... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/prob1.c | .c | 33,429 | 989 | #include <math.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <assert.h>
#include <limits.h>
#include <zlib.h>
#include "prob1.h"
#include "kstring.h"
#include "kseq.h"
KSTREAM_INIT(gzFile, gzread, 16384)
#define MC_MAX_EM_ITER 16
#define MC_EM_EPS 1e-5
#define MC_DEF_INDEL ... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/bcf.h | .h | 7,223 | 198 | /* The MIT License
Copyright (c) 2010 Broad Institute
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, mod... | Unknown |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/kmin.c | .c | 7,269 | 210 | /* The MIT License
Copyright (c) 2008, 2010 by Attractive Chaos <attractor@live.co.uk>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limita... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/vcf.c | .c | 7,040 | 250 | #include <zlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "bcf.h"
#include "kstring.h"
#include "kseq.h"
KSTREAM_INIT(gzFile, gzread, 4096)
typedef struct {
gzFile fp;
FILE *fpout;
kstream_t *ks;
void *refhash;
kstring_t line;
int max_ref;
} vcf_t;
bcf_hdr_t *vcf_hdr_read(bcf_t *bp)
... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/fet.c | .c | 3,122 | 113 | #include <math.h>
#include <stdlib.h>
/* This program is implemented with ideas from this web page:
*
* http://www.langsrud.com/fisher.htm
*/
// log\binom{n}{k}
static double lbinom(int n, int k)
{
if (k == 0 || n == k) return 0;
return lgamma(n+1) - lgamma(k+1) - lgamma(n-k+1);
}
// n11 n12 | n1_
// n21 n... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/bcf2qcall.c | .c | 3,028 | 92 | #include <errno.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "bcf.h"
static int8_t nt4_table[256] = {
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 /*'-'*/, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, ... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/bcf.c | .c | 10,569 | 397 | #include <string.h>
#include <ctype.h>
#include <stdio.h>
#include "kstring.h"
#include "bcf.h"
bcf_t *bcf_open(const char *fn, const char *mode)
{
bcf_t *b;
b = calloc(1, sizeof(bcf_t));
if (strchr(mode, 'w')) {
b->fp = strcmp(fn, "-")? bgzf_open(fn, mode) : bgzf_fdopen(fileno(stdout), mode);
} else {
b->fp =... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/kfunc.c | .c | 4,960 | 163 | #include <math.h>
/* Log gamma function
* \log{\Gamma(z)}
* AS245, 2nd algorithm, http://lib.stat.cmu.edu/apstat/245
*/
double kf_lgamma(double z)
{
double x = 0;
x += 0.1659470187408462e-06 / (z+7);
x += 0.9934937113930748e-05 / (z+6);
x -= 0.1385710331296526 / (z+5);
x += 12.50734324009056 / (z+4);... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/bcfutils.c | .c | 13,251 | 505 | #include <string.h>
#include <math.h>
#include <assert.h>
#include "bcf.h"
#include "kstring.h"
#include "khash.h"
KHASH_MAP_INIT_STR(str2id, int)
#ifdef _WIN32
#define srand48(x) srand(x)
#define drand48() ((double)rand() / RAND_MAX)
#endif
// FIXME: valgrind report a memory leak in this function. Probably it does n... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/prob1.h | .h | 1,457 | 50 | #ifndef BCF_PROB1_H
#define BCF_PROB1_H
#include "bcf.h"
struct __bcf_p1aux_t;
typedef struct __bcf_p1aux_t bcf_p1aux_t;
typedef struct {
int rank0, perm_rank; // NB: perm_rank is always set to -1 by bcf_p1_cal()
int ac; // ML alternative allele count
double f_exp, f_flat, p_ref_folded, p_ref, p_var_folded, p_var... | Unknown |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/bcftools/kmin.h | .h | 1,619 | 47 | /*
Copyright (c) 2008, 2010 by Attractive Chaos <attractor@live.co.uk>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights t... | Unknown |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/win32/zlib.h | .h | 66,188 | 1,358 | /* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.3, July 18th, 2005
Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising fro... | Unknown |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/win32/zconf.h | .h | 9,544 | 333 | /* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2005 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#ifndef ZCONF_H
#define ZCONF_H
/*
* If you *really* need a unique prefix for all types and library functions,
* com... | Unknown |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/win32/xcurses.h | .h | 49,915 | 1,378 | /* Public Domain Curses */
/* $Id: curses.h,v 1.295 2008/07/15 17:13:25 wmcbrine Exp $ */
/*----------------------------------------------------------------------*
* PDCurses *
*----------------------------------------------------------------------*/
#ifn... | Unknown |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/misc/md5.c | .c | 9,075 | 297 | /*
* This code implements the MD5 message-digest algorithm.
* The algorithm is due to Ron Rivest. This code was
* written by Colin Plumb in 1993, no copyright is claimed.
* This code is in the public domain; do with it what you wish.
*
* Equivalent code is available from RSA Data Security, Inc.
* This code has b... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/misc/md5fa.c | .c | 1,550 | 59 | #include <stdio.h>
#include <zlib.h>
#include "md5.h"
#include "kseq.h"
#define HEX_STR "0123456789abcdef"
KSEQ_INIT(gzFile, gzread)
static void md5_one(const char *fn)
{
MD5_CTX md5_one, md5_all;
int l, i, k;
gzFile fp;
kseq_t *seq;
unsigned char unordered[16], digest[16];
for (l = 0; l < 16; ++l) unordered[... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/misc/wgsim.c | .c | 14,395 | 420 | /* The MIT License
Copyright (c) 2008 Genome Research Ltd (GRL).
2011 Heng Li <lh3@live.co.uk>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, in... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/misc/bamcheck.c | .c | 59,193 | 1,522 | /*
Author: petr.danecek@sanger
gcc -Wall -Winline -g -O2 -I ~/git/samtools bamcheck.c -o bamcheck -lm -lz -L ~/git/samtools -lbam -lpthread
Assumptions, approximations and other issues:
- GC-depth graph does not split reads, the starting position determines which bin is incremented.
Th... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/misc/varfilter.py | .py | 5,783 | 206 | #!/software/bin/python
# Author: lh3, converted to python and modified to add -C option by Aylwyn Scally
#
# About:
# varfilter.py is a port of Heng's samtools.pl varFilter script into
# python, with an additional -C INT option. This option sets a minimum
# consensus score, above which the script will output a... | Python |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/misc/maq2sam.c | .c | 4,597 | 174 | #include <string.h>
#include <zlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
#include <assert.h>
#define PACKAGE_VERSION "r439"
//#define MAQ_LONGREADS
#ifdef MAQ_LONGREADS
# define MAX_READLEN 128
#else
# define MAX_READLEN 64
#endif
#define MAX_NAMELEN 36
#define MAQMAP_FORMAT_OLD 0
#defin... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/misc/md5.h | .h | 1,701 | 58 | /*
This file is adapted from a program in this page:
http://www.fourmilab.ch/md5/
The original source code does not work on 64-bit machines due to the
wrong typedef "uint32". I also added prototypes.
-lh3
*/
#ifndef MD5_H
#define MD5_H
/* The following tests optimise behaviour on little-endian
mach... | Unknown |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/misc/ace2sam.c | .c | 9,953 | 250 | /* The MIT License
Copyright (c) 2011 Heng Li <lh3@live.co.uk>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use,... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/misc/HmmGlocal.java | .java | 6,716 | 178 | import java.io.*;
import java.lang.*;
public class HmmGlocal
{
private double[] qual2prob;
private double cd, ce; // gap open probility [1e-3], gap extension probability [0.1]
private int cb; // band width [7]
public HmmGlocal(final double d, final double e, final int b) {
cd = d; ce = e; cb = b;
qual2prob = ... | Java |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/examples/chk_indel.c | .c | 2,431 | 84 | /* To compile, copy this file to the samtools source code directory and compile with:
gcc -g -O2 -Wall chk_indel_rg.c -o chk_indel_rg -Wall -I. -L. -lbam -lz
*/
#include <string.h>
#include "bam.h"
typedef struct {
long cnt[4]; // short:ins, short:del, long:ins, long:del
} rgcnt_t;
#include "khash.h"
KHASH_MAP... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/examples/calDepth.c | .c | 1,625 | 63 | #include <stdio.h>
#include "sam.h"
typedef struct {
int beg, end;
samfile_t *in;
} tmpstruct_t;
// callback for bam_fetch()
static int fetch_func(const bam1_t *b, void *data)
{
bam_plbuf_t *buf = (bam_plbuf_t*)data;
bam_plbuf_push(b, buf);
return 0;
}
// callback for bam_plbuf_init()
static int pileup_func(uint... | C |
2D | mitenjain/nanopore | submodules/samtools-0.1.19/examples/bam2bed.c | .c | 1,428 | 52 | #include <stdio.h>
#include "sam.h"
static int fetch_func(const bam1_t *b, void *data)
{
samfile_t *fp = (samfile_t*)data;
uint32_t *cigar = bam1_cigar(b);
const bam1_core_t *c = &b->core;
int i, l;
if (b->core.tid < 0) return 0;
for (i = l = 0; i < c->n_cigar; ++i) {
int op = cigar[i]&0xf;
if (op == BAM_CMAT... | C |
2D | mitenjain/nanopore | submodules/qualimap/scripts/qualimapRscript.r | .r | 23,369 | 721 | #!/usr/bin/env Rscript
if(!require("optparse")) { install.packages("optparse", repos = "http://cran.r-project.org") }
suppressPackageStartupMessages(library("optparse"))
# Last modified: 14-VI-2012
option_list <- list(
make_option(c("-v", "--verbose"), action="store_true", default=TRUE,
... | R |
2D | mitenjain/nanopore | submodules/qualimap/scripts/utils.r | .r | 8,467 | 227 | #if(!require("Repitools",quietly=T)) { source("http://bioconductor.org/biocLite.R"); biocLite("Repitools") }
suppressPackageStartupMessages(library(Repitools))
#if(!require("GenomicFeatures",quietly=T)) { source("http://bioconductor.org/biocLite.R"); biocLite("GenomicFeatures") }
suppressPackageStartupMessages(require(... | R |
2D | mitenjain/nanopore | submodules/qualimap/scripts/countsQC.r | .r | 10,716 | 341 | #!/usr/bin/env Rscript
suppressPackageStartupMessages(library(optparse))
suppressPackageStartupMessages(library(NOISeq))
option_list <- list(
make_option(c("-c", "--compare"), action="store_true",
dest="compare", help="Compare conditions"),
make_option(c("--input"), type="character", action="s... | R |
2D | mitenjain/nanopore | submodules/qualimap/scripts/init.r | .r | 303 | 12 |
is.installed <- function(mypkg) is.element(mypkg, installed.packages()[,1])
required.packages <- c('optparse', 'XML', 'Rsamtools', 'Repitools', 'rtracklayer' )
for (package in required.packages) {
if (!is.installed(package)) {
print (paste("ERROR! Package :", package, ": is missing!"))
}
}
| R |
2D | mitenjain/nanopore | submodules/qualimap/scripts/paintLocation.r | .r | 4,946 | 109 | #if(!require("optparse")) { install.packages("optparse", repos = "http://cran.r-project.org") }
#if(!require("XML")) { install.packages("XML", repos = "http://cran.r-project.org") }
suppressPackageStartupMessages(library("optparse"))
#if(!require("Repitools")) {
#source("http://bioconductor.org/biocLite.R")
#b... | R |
2D | mitenjain/nanopore | submodules/qualimap/scripts/qualimapRfunctions.r | .r | 42,920 | 1,638 | ####################################################################
################### Qualimap R Functions ####################
####################################################################
# By Sonia Tarazona, Fernando Garcia-Alcalde and Konstantin Okonechnikov
#
# This function creates input data... | R |
2D | mitenjain/nanopore | submodules/qualimap/scripts/installDependencies.r | .r | 536 | 26 | #installing deps
if(!require("optparse")) {
install.packages("optparse", repos = "http://cran.r-project.org")
}
if(!require("XML")) {
install.packages("XML", repos = "http://cran.r-project.org")
}
if(!require("Repitools")) {
source("http://bioconductor.org/biocLite.R")
biocLite("Repitools")
}
... | R |
2D | mitenjain/nanopore | submodules/qualimap/scripts/parseConfig.r | .r | 6,967 | 234 | #if(!require("XML",quietly=T)) { install.packages("XML", repos = "http://cran.r-project.org") }
suppressPackageStartupMessages(library("XML",quietly=T))
checkChild <- function(node,name, fileXML="fileConfig"){
if(is.null(node[[name]])){ stop(paste("Node <", as.character(xmlName(node)), "> does not have a child <", ... | R |
2D | mitenjain/nanopore | scripts/modifyHmm.py | .py | 1,264 | 35 | ###Modify HMMs output from EM training to normalise for background nucleotide frequencies.
from cactus.bar.cactus_expectationMaximisation import Hmm, SYMBOL_NUMBER
import sys
from nanopore.analyses.utils import setHmmIndelEmissionsToBeFlat, normaliseHmmByReferenceGCContent, modifyHmmEmissionsByExpectedVariationRate, to... | Python |
2D | mitenjain/nanopore | scripts/combine_plots_remove_trends.R | .R | 6,605 | 109 | #!/usr/bin/env Rscript
args <- commandArgs(trailingOnly = T)
#thanks SO: http://stackoverflow.com/questions/6602881/text-file-to-list-in-r
raw1 <- strsplit(readLines(args[1]), "[[:space:]]+")
data1 <- lapply(raw1, tail, n = -1)
names(data1) <- lapply(raw1, head, n = 1)
data1 <- lapply(data1, as.numeric)
pdf(args[2])... | R |
2D | mitenjain/nanopore | scripts/fast_pull_averages.py | .py | 1,757 | 57 | import xml.etree.cElementTree as ET
import sys
def find_values(f1, f2, f3):
f1 = ET.parse(f1).getroot()
f2 = ET.parse(f2).getroot()
f3 = ET.parse(f3).getroot()
m1 = float(f1.attrib['avgmismatchesPerReadBase'])
m2 = float(f2.attrib['avgmismatchesPerReadBase'])
m3 = float(f3.attrib['avgmismatche... | Python |
2D | mitenjain/nanopore | scripts/mappability_plots.R | .R | 9,667 | 140 | library(lattice)
library(latticeExtra)
pdf("combined_plots_channel_mappability.pdf")#, type="cairo")
#below is hard coded positions on the nanopore
labels <- c(125, 126, 127, 128, 253, 254, 255, 256, 381, 382, 383, 384, 509, 510, 511, 512,
121, 122, 123, 124, 249, 250, 251, 252, 377, 378, 379, 380, 505, 506... | R |
2D | mitenjain/nanopore | scripts/__init__.py | .py | 0 | 0 | null | Python |
2D | mitenjain/nanopore | scripts/tex.py | .py | 3,164 | 83 | """Lib for generating latex tables.
"""
def formatFloat(string, decimals=3):
f = float(string)
if f == 2147483647:
return "NaN"
return (("%." + str(decimals) + "f") % f)[1:]
def writeDocumentPreliminaries(fileHandle):
fileHandle.write("\\documentclass[10pt]{article}\n")
fileHandle.wri... | Python |
2D | mitenjain/nanopore | scripts/extract_from_multiple_coverage_xmls.py | .py | 1,468 | 48 | import xml.etree.cElementTree as ET
import sys
f1 = ET.parse(sys.argv[1]).getroot()
f2 = ET.parse(sys.argv[2]).getroot()
f3 = ET.parse(sys.argv[3]).getroot()
lengths = list()
identity = list()
coverage = list()
insertions = list()
deletions = list()
mismatches = list()
outf = open(sys.argv[4],"w")
for c in f1.getch... | Python |
2D | mitenjain/nanopore | scripts/variantTable.py | .py | 5,488 | 106 | import sys
from tex import *
import xml.etree.ElementTree as ET
import os.path
fileHandle = open(sys.argv[1], 'w')
writeDocumentPreliminaries(fileHandle)
recall, precision, fscore = {}, {}, {}
fileHandle2 = open(sys.argv[2], 'r')
tableNumber=1
while 1:
l = fileHandle2.readline()
if l == '':
break
... | Python |
2D | mitenjain/nanopore | scripts/make_scatter_plot.R | .R | 779 | 20 |
args <- commandArgs(trailingOnly = T)
data <- read.table(args[1],row.names=1,header=T)
pdf(args[2])
col1 <- rgb(1,0,0,0.7)
col2 <- rgb(0,1,0,0.7)
col3 <- rgb(0,0,1,0.7)
col4 <- rgb(0,0,0,0.7)
cols <- c(rep(col1,3),rep(col2,3),rep(col3,3),rep(col4,3))
plot(data$AvgInsert+data$AvgDelete,data$avgMismatch,pch=c(15,16,... | R |
2D | mitenjain/nanopore | scripts/run_blast.sh | .sh | 646 | 22 | #!/bin/bash
maxThreads=20
batchSystem=parasol
defaultJobMemory=8589934592
if [ -e ./jobTree ]; then
rm -rf ./jobTree
fi
if [ -z "$BLASTDB" ]; then
echo "Error: environmental variable BLASTDB is not set. Cannot BLAST."
exit 1
fi
#Set the python path to just these local directories
export PYTHONPATH=:../... | Shell |
2D | mitenjain/nanopore | scripts/run_muscle.sh | .sh | 1,064 | 51 | #!/bin/bash
while [[ $# > 1 ]]
do
key="$1"
shift
case $key in
--template_sam)
TEMPLATE_SAM="$1"
shift
;;
--twoD_sam)
TWOD_SAM="$1"
shift
;;
--complement_sam)
COMPLEMENT_SAM="$1"
shift
;;
esac
done
if [ ! -e $COMPLEMENT_SAM ]; then
echo "$COMPLEMENT_SAM does not exi... | Shell |
2D | mitenjain/nanopore | scripts/combined_plots.R | .R | 6,457 | 109 | #!/usr/bin/env Rscript
args <- commandArgs(trailingOnly = T)
#thanks SO: http://stackoverflow.com/questions/6602881/text-file-to-list-in-r
raw1 <- strsplit(readLines(args[1]), "[[:space:]]+")
data1 <- lapply(raw1, tail, n = -1)
names(data1) <- lapply(raw1, head, n = 1)
data1 <- lapply(data1, as.numeric)
pdf(args[2])... | R |
2D | mitenjain/nanopore | scripts/blast_combined/blast_combined.py | .py | 7,750 | 148 | #!/usr/bin/env python
import sys, os, pysam
from optparse import OptionParser
from jobTree.scriptTree.target import Target
from jobTree.scriptTree.stack import Stack
from jobTree.src.bioio import fastqRead, fastaRead, setLoggingFromOptions, logger, popenCatch, system
from itertools import izip, product
from collecti... | Python |
2D | mitenjain/nanopore | scripts/blast_combined/__init__.py | .py | 0 | 0 | null | Python |
2D | mitenjain/nanopore | scripts/blast_combined/make_blast_tex.py | .py | 1,101 | 38 | import sys, os
readTypes = ["2D","complement","template"]
files = []
for f in os.listdir(sys.argv[1]):
if f.split("_")[0] in readTypes:
readType = f.split("_")[0]
if "blast_report.txt" in f and "Fail" not in f:
files.append([os.path.join(sys.argv[1], f), readType])
files = sorted(files, key=lam... | Python |
2D | mitenjain/nanopore | scripts/blast_combined/barplot_blast.R | .R | 542 | 13 | #!/usr/bin/env Rscript
#
args <- commandArgs(trailingOnly = T)
blast <- round(as.numeric(args[1]), 3)
unmapped <- round(as.numeric(args[2]), 3)
mapped <- round(as.numeric(args[3]), 3)
readType <- args[4]
pdf(args[5])
q <- barplot(c(blast, unmapped, mapped), names.arg=c("Blast Hits", "Still Unmapped", "Originally Mappe... | R |
2D | mitenjain/nanopore | scripts/muscle_compare_2d/muscle_compare_2d.py | .py | 7,051 | 146 | #!/usr/bin/env python
import sys, os, pysam
from optparse import OptionParser
from jobTree.scriptTree.target import Target
from jobTree.scriptTree.stack import Stack
from jobTree.src.bioio import fastqRead, fastaRead, setLoggingFromOptions, logger
from subprocess import Popen, PIPE
from itertools import izip
"""
An... | Python |
2D | mitenjain/nanopore | scripts/muscle_compare_2d/__init__.py | .py | 0 | 0 | null | Python |
2D | dean0x7d/pybinding | setup.py | .py | 4,982 | 134 | import re
import os
import sys
import shutil
import platform
from subprocess import check_call, check_output, CalledProcessError
from distutils.version import LooseVersion
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext
from setuptools.command.egg_info import ... | Python |
2D | dean0x7d/pybinding | changelog.md | .md | 15,737 | 344 | # Changelog
## v0.9.5 | 2020-08-30
It has been a long time since the last version was released. The Python ecosystem has changed
quite a bit in the meantime and this has led to a number of compatibility issues when installing
or running pybinding. The main purpose of this new version is to bring this library back to ... | Markdown |
2D | dean0x7d/pybinding | license.md | .md | 1,304 | 25 | Copyright (c) 2015 - 2017, Dean Moldovan
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the follo... | Markdown |
2D | dean0x7d/pybinding | support/deploy.sh | .sh | 431 | 13 | #!/usr/bin/env bash
cd $TRAVIS_BUILD_DIR
pip install -U wheel
pip install twine
if [ "$TRAVIS_OS_NAME" = "linux" ] && [ -d "$TRAVIS_BUILD_DIR/dist" ]; then
twine upload -u $PYPI_USER -p $PYPI_PASS --skip-existing dist/*.tar.gz
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
PB_NATIVE_SIMD=OFF python setup.py bdist_w... | Shell |
2D | dean0x7d/pybinding | cppmodule/include/thread.hpp | .hpp | 912 | 44 | #pragma once
#include <pybind11/pybind11.h>
#include "detail/thread.hpp"
namespace py = pybind11;
namespace cpb {
class DeferredBase {
public:
virtual ~DeferredBase() = default;
virtual py::object solver() const = 0;
virtual void compute() = 0;
virtual py::object result() = 0;
};
template<class Res... | Unknown |
2D | dean0x7d/pybinding | cppmodule/include/resolve.hpp | .hpp | 1,041 | 26 | #pragma once
/// Syntax sugar for resolving overloaded function pointers:
/// - regular: static_cast<Return (Class::*)(Arg0, Arg1, Arg2)>(&Class::func)
/// - sweet: &Class::func | resolve<Arg0, Arg1, Arg2>()
template<class... Args>
struct resolve {
template<class Return>
friend constexpr auto operator|(Ret... | Unknown |
2D | dean0x7d/pybinding | cppmodule/include/wrappers.hpp | .hpp | 659 | 28 | #pragma once
#include "detail/config.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/functional.h>
#include <pybind11/stl.h>
#include <pybind11/eigen.h>
#include "cast.hpp"
#include "resolve.hpp"
namespace py = pybind11;
using namespace py::literals;
using release_gil = py::call_guard<py::gil_scoped_release>... | Unknown |
2D | dean0x7d/pybinding | cppmodule/include/cast.hpp | .hpp | 6,133 | 157 | #pragma once
#include "numeric/arrayref.hpp"
#include "numeric/sparseref.hpp"
#include "support/variant.hpp"
#include "detail/opaque_alias.hpp"
namespace pybind11 { namespace detail {
template<>
struct visit_helper<cpb::var::variant> {
template<class... Args>
static auto call(Args&&... args)
-> declty... | Unknown |
2D | dean0x7d/pybinding | cppmodule/src/lattice.cpp | .cpp | 5,097 | 92 | #include "Lattice.hpp"
#include "wrappers.hpp"
using namespace cpb;
void wrap_lattice(py::module& m) {
using Sub = Lattice::Sublattice;
py::class_<Sub>(m, "Sublattice")
.def_readonly("position", &Sub::position, "Relative to global lattice offset")
.def_readonly("energy", &Sub::energy, "Onsite e... | C++ |
2D | dean0x7d/pybinding | cppmodule/src/model.cpp | .cpp | 1,884 | 41 | #include "Model.hpp"
#include "wrappers.hpp"
using namespace cpb;
void wrap_model(py::module& m) {
py::class_<Model>(m, "Model")
.def(py::init<Lattice const&>())
.def("add", &Model::add | resolve<Primitive>())
.def("add", &Model::add | resolve<Shape const&>())
.def("add", &Model::ad... | C++ |
2D | dean0x7d/pybinding | cppmodule/src/system.cpp | .cpp | 6,334 | 120 | #include "system/System.hpp"
#include "wrappers.hpp"
using namespace cpb;
template<class T>
void wrap_registry(py::module& m, char const* name) {
py::class_<T>(m, name)
.def_property_readonly("name_map", &T::name_map)
.def(py::pickle([](T const& r) {
return py::dict("energies"_a=r.get_e... | C++ |
2D | dean0x7d/pybinding | cppmodule/src/leads.cpp | .cpp | 846 | 25 | #include "leads/Leads.hpp"
#include "wrappers.hpp"
using namespace cpb;
void wrap_leads(py::module& m) {
py::class_<leads::Spec>(m, "LeadSpec")
.def_readonly("axis", &leads::Spec::axis)
.def_readonly("sign", &leads::Spec::sign)
.def_readonly("shape", &leads::Spec::shape)
;
py::clas... | C++ |
2D | dean0x7d/pybinding | cppmodule/src/solver.cpp | .cpp | 1,651 | 38 | #include "solver/Solver.hpp"
#include "solver/FEAST.hpp"
#include "wrappers.hpp"
using namespace cpb;
void wrap_solver(py::module& m) {
py::class_<BaseSolver>(m, "Solver")
.def("solve", &BaseSolver::solve)
.def("clear", &BaseSolver::clear)
.def("report", &BaseSolver::report, "shortform"_a=f... | C++ |
2D | dean0x7d/pybinding | cppmodule/src/main.cpp | .cpp | 1,383 | 52 | #include "wrappers.hpp"
#include "support/simd.hpp"
#ifdef CPB_USE_MKL
# include <mkl.h>
#endif
using namespace cpb;
PYBIND11_MODULE(_pybinding, m) {
wrap_greens(m);
wrap_lattice(m);
wrap_leads(m);
wrap_model(m);
wrap_modifiers(m);
wrap_parallel(m);
wrap_shape(m);
wrap_solver(m);
w... | C++ |
2D | dean0x7d/pybinding | cppmodule/src/modifiers.cpp | .cpp | 6,010 | 140 | #include "system/StructureModifiers.hpp"
#include "hamiltonian/HamiltonianModifiers.hpp"
#include "wrappers.hpp"
using namespace cpb;
namespace {
/// Extract an Eigen array from a Python object, but avoid a copy if possible
struct ExtractModifierResult {
py::object o;
template<class EigenType>
void opera... | C++ |
2D | dean0x7d/pybinding | cppmodule/src/parallel.cpp | .cpp | 1,769 | 47 | #include "wrappers.hpp"
#include "thread.hpp"
#include "numeric/dense.hpp"
using namespace cpb;
void wrap_parallel(py::module& m) {
py::class_<DeferredBase, std::shared_ptr<DeferredBase>>(m, "DeferredBase")
.def("compute", &DeferredBase::compute)
.def_property_readonly("solver", &DeferredBase::solv... | C++ |
2D | dean0x7d/pybinding | cppmodule/src/shape.cpp | .cpp | 1,901 | 53 | #include "system/Shape.hpp"
#include "system/Symmetry.hpp"
#include "wrappers.hpp"
using namespace cpb;
void wrap_shape(py::module& m) {
py::class_<Primitive>(m, "Primitive")
.def(py::init<int, int, int>());
using RefX = Eigen::Ref<Eigen::ArrayXf const>;
py::class_<Shape>(m, "Shape")
.def... | C++ |
2D | dean0x7d/pybinding | cppmodule/src/kpm.cpp | .cpp | 5,615 | 127 | #include "KPM.hpp"
#include "wrappers.hpp"
#include "thread.hpp"
using namespace cpb;
namespace {
void wrap_kpm_strategy(py::module& m, char const* name) {
auto const kpm_defaults = kpm::Config();
m.def(
name,
[](Model const& model, std::pair<float, float> energy, kpm::Kernel const& kernel,
... | C++ |
2D | dean0x7d/pybinding | cppmodule/src/wrapper_tests.cpp | .cpp | 714 | 27 | #include "wrappers.hpp"
namespace {
struct TestArrayRef {
Eigen::ArrayXi a = Eigen::ArrayXi::LinSpaced(12, 0, 12);
};
}
void wrapper_tests(py::module& pm) {
auto m = pm.def_submodule("wrapper_tests");
m.def("variant_load", [](cpb::var::variant<int, std::string> v) {
return v.is<int>()... | C++ |
2D | dean0x7d/pybinding | cppcore/include/Lattice.hpp | .hpp | 8,080 | 192 | #pragma once
#include "system/Registry.hpp"
#include <vector>
namespace cpb {
class OptimizedUnitCell;
/**
Crystal lattice specification
*/
class Lattice {
public:
struct Sublattice {
Cartesian position; ///< relative to lattice origin
MatrixXcd energy; ///< onsite energy term
SubID un... | Unknown |
2D | dean0x7d/pybinding | cppcore/include/KPM.hpp | .hpp | 2,178 | 52 | #pragma once
#include "kpm/default/Compute.hpp"
namespace cpb {
/**
Kernel Polynomial Method calculation interface
*/
class KPM {
public:
KPM(Model const& model, kpm::Compute const& compute = kpm::DefaultCompute{},
kpm::Config const& config = {});
void set_model(Model const&);
Model const& get_... | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.