├── .gitignore ├── .gitmodules ├── .travis.yml ├── LICENSE ├── Makefile.am ├── Makefile.in ├── README.md ├── autogen.sh ├── config.h ├── config.h.in ├── configure ├── configure.ac ├── depcomp ├── install-sh ├── missing └── src ├── Makefile.am ├── Makefile.in ├── bxcommon.h ├── bxconvert.cpp ├── bxconvert.h ├── bxgroup.cpp ├── bxgroup.h ├── bxmol.cpp ├── bxmol.h ├── bxrelabel.cpp ├── bxrelabel.h ├── bxsplit.cpp ├── bxsplit.h ├── bxstats.cpp ├── bxstats.h ├── bxtile.cpp ├── bxtile.h └── bxtools.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | SVSim* 2 | [#]*[#] 3 | .\#* 4 | *~ 5 | *.csv 6 | *.o 7 | *.gif 8 | *.gcda 9 | *.gcno 10 | *.gcov 11 | .* 12 | Test 13 | autom4te.cache 14 | .Rhistory 15 | .in 16 | .deps* 17 | html 18 | latex 19 | config.log 20 | tmp* 21 | libhts.* 22 | libsnowtools.a 23 | libaho* 24 | libbwa.a 25 | example* 26 | tabix 27 | htsfile 28 | bgzip 29 | back* 30 | *.m4 31 | *.bam 32 | bxtools 33 | stamp-h1 34 | config.status 35 | Makefile 36 | *.pico 37 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "SeqLib"] 2 | path = SeqLib 3 | url = https://github.com/walaj/SeqLib 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | compiler: 4 | - gcc 5 | 6 | env: 7 | global: 8 | - secure: ck5M5R8YqNGA5LFmE5NdkkNvYMqwKg4v/b9/VE+Zhdw87Vx4xE44aHh/TxtQYDvrhzrmLWjmnCRR0g7TfXWCZ/Nq3gWqVqUe4j/ltG+zzI/3LWViZN6i91G/12LAgE/LZpyDnJOssbGYB5jDtYS4SgFmgTpYkFHfAuZWKOblMl7eP5DBCBTAe7GynDmCnSo3BDaYnQ1k1d7q9u/LxeMx2SOvbZF5tkanVvSthYAMiKgnyOwQSSWnitvrBrx4KwoyW6D8TT1W0PSl2ZggHYHreM22/F3MWGJeDNcdz5uA3EhpMP1ZYnAaSN4pgRv5D1/fuilmgn1IjBeoDTInQf6p0ri1L4Z3NmY+Plr75Q7/pOhjfWFw033AYh7Sio83lTR1mWL/u9ri39btjrn2tfRuBFzPlIVrYwRBHIxUMqYqt89epe+w8/0kdBzFCnwsSPjQEc2cyBwrmXvKZZJImnmAOPb4IwtSmPdNNC6smkWUKV+kiktuiCX8NnNU82cuESVBblwTfcpqfnUAxY1+adDEPTP/r1HfbPOU4tr790FpUqOhFNwIruzyGYFVX/jMHtYFwlz9fTGrLp+2fSRuFRFU+kHYJcL3BRM13kEQFoqkdyO5X6Xpqn+PlnaEABttIT++Hm57QyeapBiVrrCjWENhY3ZKJs6U+7daKy11boUd2go= 9 | 10 | before_install: 11 | - git submodule update --init --recursive 12 | - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y 13 | - sudo apt-get update 14 | - sudo apt-get install python-yaml libyaml-dev build-essential libssh2-1-dev libarchive-dev lzma 15 | - sudo apt-get install gcc-4.9 g++-4.9 16 | - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20 17 | - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20 18 | - sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.9 20 19 | - sudo update-alternatives --config gcc 20 | - sudo update-alternatives --config g++ 21 | - if [ "${CXX}" = "g++" ]; then export CXX="$(which g++-4.9)"; export CC="$(which gcc-4.9)"; fi 22 | - if [ "${TRAVIS_OS_NAME}" = "osx" -a "${CXX}" = "clang++" ]; then export CXX="$(which c++)"; export CC="$(which cc)"; fi 23 | 24 | script: 25 | - ./configure && make 26 | 27 | branches: 28 | only: 29 | - master 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Jeremiah Wala 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = foreign 2 | SUBDIRS = SeqLib/htslib SeqLib/src src 3 | 4 | install: 5 | mkdir -p bin && cp src/bxtools bin 6 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.15 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994-2014 Free Software Foundation, Inc. 5 | 6 | # This Makefile.in is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | @SET_MAKE@ 16 | VPATH = @srcdir@ 17 | am__is_gnu_make = { \ 18 | if test -z '$(MAKELEVEL)'; then \ 19 | false; \ 20 | elif test -n '$(MAKE_HOST)'; then \ 21 | true; \ 22 | elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ 23 | true; \ 24 | else \ 25 | false; \ 26 | fi; \ 27 | } 28 | am__make_running_with_option = \ 29 | case $${target_option-} in \ 30 | ?) ;; \ 31 | *) echo "am__make_running_with_option: internal error: invalid" \ 32 | "target option '$${target_option-}' specified" >&2; \ 33 | exit 1;; \ 34 | esac; \ 35 | has_opt=no; \ 36 | sane_makeflags=$$MAKEFLAGS; \ 37 | if $(am__is_gnu_make); then \ 38 | sane_makeflags=$$MFLAGS; \ 39 | else \ 40 | case $$MAKEFLAGS in \ 41 | *\\[\ \ ]*) \ 42 | bs=\\; \ 43 | sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ 44 | | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ 45 | esac; \ 46 | fi; \ 47 | skip_next=no; \ 48 | strip_trailopt () \ 49 | { \ 50 | flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ 51 | }; \ 52 | for flg in $$sane_makeflags; do \ 53 | test $$skip_next = yes && { skip_next=no; continue; }; \ 54 | case $$flg in \ 55 | *=*|--*) continue;; \ 56 | -*I) strip_trailopt 'I'; skip_next=yes;; \ 57 | -*I?*) strip_trailopt 'I';; \ 58 | -*O) strip_trailopt 'O'; skip_next=yes;; \ 59 | -*O?*) strip_trailopt 'O';; \ 60 | -*l) strip_trailopt 'l'; skip_next=yes;; \ 61 | -*l?*) strip_trailopt 'l';; \ 62 | -[dEDm]) skip_next=yes;; \ 63 | -[JT]) skip_next=yes;; \ 64 | esac; \ 65 | case $$flg in \ 66 | *$$target_option*) has_opt=yes; break;; \ 67 | esac; \ 68 | done; \ 69 | test $$has_opt = yes 70 | am__make_dryrun = (target_option=n; $(am__make_running_with_option)) 71 | am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 72 | pkgdatadir = $(datadir)/@PACKAGE@ 73 | pkgincludedir = $(includedir)/@PACKAGE@ 74 | pkglibdir = $(libdir)/@PACKAGE@ 75 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 76 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 77 | install_sh_DATA = $(install_sh) -c -m 644 78 | install_sh_PROGRAM = $(install_sh) -c 79 | install_sh_SCRIPT = $(install_sh) -c 80 | INSTALL_HEADER = $(INSTALL_DATA) 81 | transform = $(program_transform_name) 82 | NORMAL_INSTALL = : 83 | PRE_INSTALL = : 84 | POST_INSTALL = : 85 | NORMAL_UNINSTALL = : 86 | PRE_UNINSTALL = : 87 | POST_UNINSTALL = : 88 | subdir = . 89 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 90 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 91 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 92 | $(ACLOCAL_M4) 93 | DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ 94 | $(am__configure_deps) $(am__DIST_COMMON) 95 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ 96 | configure.lineno config.status.lineno 97 | mkinstalldirs = $(install_sh) -d 98 | CONFIG_HEADER = config.h 99 | CONFIG_CLEAN_FILES = 100 | CONFIG_CLEAN_VPATH_FILES = 101 | AM_V_P = $(am__v_P_@AM_V@) 102 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) 103 | am__v_P_0 = false 104 | am__v_P_1 = : 105 | AM_V_GEN = $(am__v_GEN_@AM_V@) 106 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) 107 | am__v_GEN_0 = @echo " GEN " $@; 108 | am__v_GEN_1 = 109 | AM_V_at = $(am__v_at_@AM_V@) 110 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) 111 | am__v_at_0 = @ 112 | am__v_at_1 = 113 | SOURCES = 114 | DIST_SOURCES = 115 | RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ 116 | ctags-recursive dvi-recursive html-recursive info-recursive \ 117 | install-data-recursive install-dvi-recursive \ 118 | install-exec-recursive install-html-recursive \ 119 | install-info-recursive install-pdf-recursive \ 120 | install-ps-recursive install-recursive installcheck-recursive \ 121 | installdirs-recursive pdf-recursive ps-recursive \ 122 | tags-recursive uninstall-recursive 123 | am__can_run_installinfo = \ 124 | case $$AM_UPDATE_INFO_DIR in \ 125 | n|no|NO) false;; \ 126 | *) (install-info --version) >/dev/null 2>&1;; \ 127 | esac 128 | RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ 129 | distclean-recursive maintainer-clean-recursive 130 | am__recursive_targets = \ 131 | $(RECURSIVE_TARGETS) \ 132 | $(RECURSIVE_CLEAN_TARGETS) \ 133 | $(am__extra_recursive_targets) 134 | AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ 135 | cscope distdir dist dist-all distcheck 136 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ 137 | $(LISP)config.h.in 138 | # Read a list of newline-separated strings from the standard input, 139 | # and print each of them once, without duplicates. Input order is 140 | # *not* preserved. 141 | am__uniquify_input = $(AWK) '\ 142 | BEGIN { nonempty = 0; } \ 143 | { items[$$0] = 1; nonempty = 1; } \ 144 | END { if (nonempty) { for (i in items) print i; }; } \ 145 | ' 146 | # Make sure the list of sources is unique. This is necessary because, 147 | # e.g., the same source file might be shared among _SOURCES variables 148 | # for different programs/libraries. 149 | am__define_uniq_tagged_files = \ 150 | list='$(am__tagged_files)'; \ 151 | unique=`for i in $$list; do \ 152 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 153 | done | $(am__uniquify_input)` 154 | ETAGS = etags 155 | CTAGS = ctags 156 | CSCOPE = cscope 157 | DIST_SUBDIRS = $(SUBDIRS) 158 | am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in compile \ 159 | depcomp install-sh missing 160 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 161 | distdir = $(PACKAGE)-$(VERSION) 162 | top_distdir = $(distdir) 163 | am__remove_distdir = \ 164 | if test -d "$(distdir)"; then \ 165 | find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ 166 | && rm -rf "$(distdir)" \ 167 | || { sleep 5 && rm -rf "$(distdir)"; }; \ 168 | else :; fi 169 | am__post_remove_distdir = $(am__remove_distdir) 170 | am__relativize = \ 171 | dir0=`pwd`; \ 172 | sed_first='s,^\([^/]*\)/.*$$,\1,'; \ 173 | sed_rest='s,^[^/]*/*,,'; \ 174 | sed_last='s,^.*/\([^/]*\)$$,\1,'; \ 175 | sed_butlast='s,/*[^/]*$$,,'; \ 176 | while test -n "$$dir1"; do \ 177 | first=`echo "$$dir1" | sed -e "$$sed_first"`; \ 178 | if test "$$first" != "."; then \ 179 | if test "$$first" = ".."; then \ 180 | dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ 181 | dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ 182 | else \ 183 | first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ 184 | if test "$$first2" = "$$first"; then \ 185 | dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ 186 | else \ 187 | dir2="../$$dir2"; \ 188 | fi; \ 189 | dir0="$$dir0"/"$$first"; \ 190 | fi; \ 191 | fi; \ 192 | dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ 193 | done; \ 194 | reldir="$$dir2" 195 | DIST_ARCHIVES = $(distdir).tar.gz 196 | GZIP_ENV = --best 197 | DIST_TARGETS = dist-gzip 198 | distuninstallcheck_listfiles = find . -type f -print 199 | am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ 200 | | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' 201 | distcleancheck_listfiles = find . -type f -print 202 | ACLOCAL = @ACLOCAL@ 203 | AMTAR = @AMTAR@ 204 | AM_CXXFLAGS = @AM_CXXFLAGS@ 205 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 206 | AUTOCONF = @AUTOCONF@ 207 | AUTOHEADER = @AUTOHEADER@ 208 | AUTOMAKE = @AUTOMAKE@ 209 | AWK = @AWK@ 210 | CC = @CC@ 211 | CCDEPMODE = @CCDEPMODE@ 212 | CFLAGS = @CFLAGS@ 213 | CPPFLAGS = @CPPFLAGS@ 214 | CXX = @CXX@ 215 | CXXCPP = @CXXCPP@ 216 | CXXDEPMODE = @CXXDEPMODE@ 217 | CXXFLAGS = @CXXFLAGS@ 218 | CYGPATH_W = @CYGPATH_W@ 219 | DEFS = @DEFS@ 220 | DEPDIR = @DEPDIR@ 221 | ECHO_C = @ECHO_C@ 222 | ECHO_N = @ECHO_N@ 223 | ECHO_T = @ECHO_T@ 224 | EGREP = @EGREP@ 225 | EXEEXT = @EXEEXT@ 226 | GREP = @GREP@ 227 | INSTALL = @INSTALL@ 228 | INSTALL_DATA = @INSTALL_DATA@ 229 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 230 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 231 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 232 | LDFLAGS = @LDFLAGS@ 233 | LIBOBJS = @LIBOBJS@ 234 | LIBS = @LIBS@ 235 | LTLIBOBJS = @LTLIBOBJS@ 236 | MAINT = @MAINT@ 237 | MAKEINFO = @MAKEINFO@ 238 | MKDIR_P = @MKDIR_P@ 239 | OBJEXT = @OBJEXT@ 240 | PACKAGE = @PACKAGE@ 241 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 242 | PACKAGE_NAME = @PACKAGE_NAME@ 243 | PACKAGE_STRING = @PACKAGE_STRING@ 244 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 245 | PACKAGE_URL = @PACKAGE_URL@ 246 | PACKAGE_VERSION = @PACKAGE_VERSION@ 247 | PATH_SEPARATOR = @PATH_SEPARATOR@ 248 | RANLIB = @RANLIB@ 249 | SET_MAKE = @SET_MAKE@ 250 | SHELL = @SHELL@ 251 | STRIP = @STRIP@ 252 | VERSION = @VERSION@ 253 | abs_builddir = @abs_builddir@ 254 | abs_srcdir = @abs_srcdir@ 255 | abs_top_builddir = @abs_top_builddir@ 256 | abs_top_srcdir = @abs_top_srcdir@ 257 | ac_ct_CC = @ac_ct_CC@ 258 | ac_ct_CXX = @ac_ct_CXX@ 259 | am__include = @am__include@ 260 | am__leading_dot = @am__leading_dot@ 261 | am__quote = @am__quote@ 262 | am__tar = @am__tar@ 263 | am__untar = @am__untar@ 264 | bindir = @bindir@ 265 | build_alias = @build_alias@ 266 | builddir = @builddir@ 267 | datadir = @datadir@ 268 | datarootdir = @datarootdir@ 269 | docdir = @docdir@ 270 | dvidir = @dvidir@ 271 | exec_prefix = @exec_prefix@ 272 | host_alias = @host_alias@ 273 | htmldir = @htmldir@ 274 | includedir = @includedir@ 275 | infodir = @infodir@ 276 | install_sh = @install_sh@ 277 | libdir = @libdir@ 278 | libexecdir = @libexecdir@ 279 | localedir = @localedir@ 280 | localstatedir = @localstatedir@ 281 | mandir = @mandir@ 282 | mkdir_p = @mkdir_p@ 283 | oldincludedir = @oldincludedir@ 284 | pdfdir = @pdfdir@ 285 | prefix = @prefix@ 286 | program_transform_name = @program_transform_name@ 287 | psdir = @psdir@ 288 | sbindir = @sbindir@ 289 | sharedstatedir = @sharedstatedir@ 290 | srcdir = @srcdir@ 291 | sysconfdir = @sysconfdir@ 292 | target_alias = @target_alias@ 293 | top_build_prefix = @top_build_prefix@ 294 | top_builddir = @top_builddir@ 295 | top_srcdir = @top_srcdir@ 296 | AUTOMAKE_OPTIONS = foreign 297 | SUBDIRS = SeqLib/htslib SeqLib/src src 298 | all: config.h 299 | $(MAKE) $(AM_MAKEFLAGS) all-recursive 300 | 301 | .SUFFIXES: 302 | am--refresh: Makefile 303 | @: 304 | $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) 305 | @for dep in $?; do \ 306 | case '$(am__configure_deps)' in \ 307 | *$$dep*) \ 308 | echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ 309 | $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ 310 | && exit 0; \ 311 | exit 1;; \ 312 | esac; \ 313 | done; \ 314 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ 315 | $(am__cd) $(top_srcdir) && \ 316 | $(AUTOMAKE) --foreign Makefile 317 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 318 | @case '$?' in \ 319 | *config.status*) \ 320 | echo ' $(SHELL) ./config.status'; \ 321 | $(SHELL) ./config.status;; \ 322 | *) \ 323 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ 324 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ 325 | esac; 326 | 327 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 328 | $(SHELL) ./config.status --recheck 329 | 330 | $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 331 | $(am__cd) $(srcdir) && $(AUTOCONF) 332 | $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) 333 | $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 334 | $(am__aclocal_m4_deps): 335 | 336 | config.h: stamp-h1 337 | @test -f $@ || rm -f stamp-h1 338 | @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 339 | 340 | stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status 341 | @rm -f stamp-h1 342 | cd $(top_builddir) && $(SHELL) ./config.status config.h 343 | $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 344 | ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) 345 | rm -f stamp-h1 346 | touch $@ 347 | 348 | distclean-hdr: 349 | -rm -f config.h stamp-h1 350 | 351 | # This directory's subdirectories are mostly independent; you can cd 352 | # into them and run 'make' without going through this Makefile. 353 | # To change the values of 'make' variables: instead of editing Makefiles, 354 | # (1) if the variable is set in 'config.status', edit 'config.status' 355 | # (which will cause the Makefiles to be regenerated when you run 'make'); 356 | # (2) otherwise, pass the desired values on the 'make' command line. 357 | $(am__recursive_targets): 358 | @fail=; \ 359 | if $(am__make_keepgoing); then \ 360 | failcom='fail=yes'; \ 361 | else \ 362 | failcom='exit 1'; \ 363 | fi; \ 364 | dot_seen=no; \ 365 | target=`echo $@ | sed s/-recursive//`; \ 366 | case "$@" in \ 367 | distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ 368 | *) list='$(SUBDIRS)' ;; \ 369 | esac; \ 370 | for subdir in $$list; do \ 371 | echo "Making $$target in $$subdir"; \ 372 | if test "$$subdir" = "."; then \ 373 | dot_seen=yes; \ 374 | local_target="$$target-am"; \ 375 | else \ 376 | local_target="$$target"; \ 377 | fi; \ 378 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 379 | || eval $$failcom; \ 380 | done; \ 381 | if test "$$dot_seen" = "no"; then \ 382 | $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ 383 | fi; test -z "$$fail" 384 | 385 | ID: $(am__tagged_files) 386 | $(am__define_uniq_tagged_files); mkid -fID $$unique 387 | tags: tags-recursive 388 | TAGS: tags 389 | 390 | tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 391 | set x; \ 392 | here=`pwd`; \ 393 | if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ 394 | include_option=--etags-include; \ 395 | empty_fix=.; \ 396 | else \ 397 | include_option=--include; \ 398 | empty_fix=; \ 399 | fi; \ 400 | list='$(SUBDIRS)'; for subdir in $$list; do \ 401 | if test "$$subdir" = .; then :; else \ 402 | test ! -f $$subdir/TAGS || \ 403 | set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ 404 | fi; \ 405 | done; \ 406 | $(am__define_uniq_tagged_files); \ 407 | shift; \ 408 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 409 | test -n "$$unique" || unique=$$empty_fix; \ 410 | if test $$# -gt 0; then \ 411 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 412 | "$$@" $$unique; \ 413 | else \ 414 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 415 | $$unique; \ 416 | fi; \ 417 | fi 418 | ctags: ctags-recursive 419 | 420 | CTAGS: ctags 421 | ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 422 | $(am__define_uniq_tagged_files); \ 423 | test -z "$(CTAGS_ARGS)$$unique" \ 424 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 425 | $$unique 426 | 427 | GTAGS: 428 | here=`$(am__cd) $(top_builddir) && pwd` \ 429 | && $(am__cd) $(top_srcdir) \ 430 | && gtags -i $(GTAGS_ARGS) "$$here" 431 | cscope: cscope.files 432 | test ! -s cscope.files \ 433 | || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) 434 | clean-cscope: 435 | -rm -f cscope.files 436 | cscope.files: clean-cscope cscopelist 437 | cscopelist: cscopelist-recursive 438 | 439 | cscopelist-am: $(am__tagged_files) 440 | list='$(am__tagged_files)'; \ 441 | case "$(srcdir)" in \ 442 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ 443 | *) sdir=$(subdir)/$(srcdir) ;; \ 444 | esac; \ 445 | for i in $$list; do \ 446 | if test -f "$$i"; then \ 447 | echo "$(subdir)/$$i"; \ 448 | else \ 449 | echo "$$sdir/$$i"; \ 450 | fi; \ 451 | done >> $(top_builddir)/cscope.files 452 | 453 | distclean-tags: 454 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 455 | -rm -f cscope.out cscope.in.out cscope.po.out cscope.files 456 | 457 | distdir: $(DISTFILES) 458 | $(am__remove_distdir) 459 | test -d "$(distdir)" || mkdir "$(distdir)" 460 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 461 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 462 | list='$(DISTFILES)'; \ 463 | dist_files=`for file in $$list; do echo $$file; done | \ 464 | sed -e "s|^$$srcdirstrip/||;t" \ 465 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 466 | case $$dist_files in \ 467 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 468 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 469 | sort -u` ;; \ 470 | esac; \ 471 | for file in $$dist_files; do \ 472 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 473 | if test -d $$d/$$file; then \ 474 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 475 | if test -d "$(distdir)/$$file"; then \ 476 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 477 | fi; \ 478 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 479 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 480 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 481 | fi; \ 482 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 483 | else \ 484 | test -f "$(distdir)/$$file" \ 485 | || cp -p $$d/$$file "$(distdir)/$$file" \ 486 | || exit 1; \ 487 | fi; \ 488 | done 489 | @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 490 | if test "$$subdir" = .; then :; else \ 491 | $(am__make_dryrun) \ 492 | || test -d "$(distdir)/$$subdir" \ 493 | || $(MKDIR_P) "$(distdir)/$$subdir" \ 494 | || exit 1; \ 495 | dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ 496 | $(am__relativize); \ 497 | new_distdir=$$reldir; \ 498 | dir1=$$subdir; dir2="$(top_distdir)"; \ 499 | $(am__relativize); \ 500 | new_top_distdir=$$reldir; \ 501 | echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ 502 | echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ 503 | ($(am__cd) $$subdir && \ 504 | $(MAKE) $(AM_MAKEFLAGS) \ 505 | top_distdir="$$new_top_distdir" \ 506 | distdir="$$new_distdir" \ 507 | am__remove_distdir=: \ 508 | am__skip_length_check=: \ 509 | am__skip_mode_fix=: \ 510 | distdir) \ 511 | || exit 1; \ 512 | fi; \ 513 | done 514 | -test -n "$(am__skip_mode_fix)" \ 515 | || find "$(distdir)" -type d ! -perm -755 \ 516 | -exec chmod u+rwx,go+rx {} \; -o \ 517 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ 518 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ 519 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ 520 | || chmod -R a+r "$(distdir)" 521 | dist-gzip: distdir 522 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 523 | $(am__post_remove_distdir) 524 | 525 | dist-bzip2: distdir 526 | tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 527 | $(am__post_remove_distdir) 528 | 529 | dist-lzip: distdir 530 | tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz 531 | $(am__post_remove_distdir) 532 | 533 | dist-xz: distdir 534 | tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz 535 | $(am__post_remove_distdir) 536 | 537 | dist-tarZ: distdir 538 | @echo WARNING: "Support for distribution archives compressed with" \ 539 | "legacy program 'compress' is deprecated." >&2 540 | @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 541 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z 542 | $(am__post_remove_distdir) 543 | 544 | dist-shar: distdir 545 | @echo WARNING: "Support for shar distribution archives is" \ 546 | "deprecated." >&2 547 | @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 548 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz 549 | $(am__post_remove_distdir) 550 | 551 | dist-zip: distdir 552 | -rm -f $(distdir).zip 553 | zip -rq $(distdir).zip $(distdir) 554 | $(am__post_remove_distdir) 555 | 556 | dist dist-all: 557 | $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' 558 | $(am__post_remove_distdir) 559 | 560 | # This target untars the dist file and tries a VPATH configuration. Then 561 | # it guarantees that the distribution is self-contained by making another 562 | # tarfile. 563 | distcheck: dist 564 | case '$(DIST_ARCHIVES)' in \ 565 | *.tar.gz*) \ 566 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ 567 | *.tar.bz2*) \ 568 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ 569 | *.tar.lz*) \ 570 | lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ 571 | *.tar.xz*) \ 572 | xz -dc $(distdir).tar.xz | $(am__untar) ;;\ 573 | *.tar.Z*) \ 574 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ 575 | *.shar.gz*) \ 576 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ 577 | *.zip*) \ 578 | unzip $(distdir).zip ;;\ 579 | esac 580 | chmod -R a-w $(distdir) 581 | chmod u+w $(distdir) 582 | mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst 583 | chmod a-w $(distdir) 584 | test -d $(distdir)/_build || exit 0; \ 585 | dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ 586 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ 587 | && am__cwd=`pwd` \ 588 | && $(am__cd) $(distdir)/_build/sub \ 589 | && ../../configure \ 590 | $(AM_DISTCHECK_CONFIGURE_FLAGS) \ 591 | $(DISTCHECK_CONFIGURE_FLAGS) \ 592 | --srcdir=../.. --prefix="$$dc_install_base" \ 593 | && $(MAKE) $(AM_MAKEFLAGS) \ 594 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ 595 | && $(MAKE) $(AM_MAKEFLAGS) check \ 596 | && $(MAKE) $(AM_MAKEFLAGS) install \ 597 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ 598 | && $(MAKE) $(AM_MAKEFLAGS) uninstall \ 599 | && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ 600 | distuninstallcheck \ 601 | && chmod -R a-w "$$dc_install_base" \ 602 | && ({ \ 603 | (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ 604 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ 605 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ 606 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ 607 | distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ 608 | } || { rm -rf "$$dc_destdir"; exit 1; }) \ 609 | && rm -rf "$$dc_destdir" \ 610 | && $(MAKE) $(AM_MAKEFLAGS) dist \ 611 | && rm -rf $(DIST_ARCHIVES) \ 612 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ 613 | && cd "$$am__cwd" \ 614 | || exit 1 615 | $(am__post_remove_distdir) 616 | @(echo "$(distdir) archives ready for distribution: "; \ 617 | list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ 618 | sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' 619 | distuninstallcheck: 620 | @test -n '$(distuninstallcheck_dir)' || { \ 621 | echo 'ERROR: trying to run $@ with an empty' \ 622 | '$$(distuninstallcheck_dir)' >&2; \ 623 | exit 1; \ 624 | }; \ 625 | $(am__cd) '$(distuninstallcheck_dir)' || { \ 626 | echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ 627 | exit 1; \ 628 | }; \ 629 | test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ 630 | || { echo "ERROR: files left after uninstall:" ; \ 631 | if test -n "$(DESTDIR)"; then \ 632 | echo " (check DESTDIR support)"; \ 633 | fi ; \ 634 | $(distuninstallcheck_listfiles) ; \ 635 | exit 1; } >&2 636 | distcleancheck: distclean 637 | @if test '$(srcdir)' = . ; then \ 638 | echo "ERROR: distcleancheck can only run from a VPATH build" ; \ 639 | exit 1 ; \ 640 | fi 641 | @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ 642 | || { echo "ERROR: files left in build directory after distclean:" ; \ 643 | $(distcleancheck_listfiles) ; \ 644 | exit 1; } >&2 645 | check-am: all-am 646 | check: check-recursive 647 | all-am: Makefile config.h 648 | installdirs: installdirs-recursive 649 | installdirs-am: 650 | install-exec: install-exec-recursive 651 | install-data: install-data-recursive 652 | uninstall: uninstall-recursive 653 | 654 | install-am: all-am 655 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 656 | 657 | installcheck: installcheck-recursive 658 | install-strip: 659 | if test -z '$(STRIP)'; then \ 660 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 661 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 662 | install; \ 663 | else \ 664 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 665 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 666 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 667 | fi 668 | mostlyclean-generic: 669 | 670 | clean-generic: 671 | 672 | distclean-generic: 673 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 674 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 675 | 676 | maintainer-clean-generic: 677 | @echo "This command is intended for maintainers to use" 678 | @echo "it deletes files that may require special tools to rebuild." 679 | clean: clean-recursive 680 | 681 | clean-am: clean-generic mostlyclean-am 682 | 683 | distclean: distclean-recursive 684 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 685 | -rm -f Makefile 686 | distclean-am: clean-am distclean-generic distclean-hdr distclean-tags 687 | 688 | dvi: dvi-recursive 689 | 690 | dvi-am: 691 | 692 | html: html-recursive 693 | 694 | html-am: 695 | 696 | info: info-recursive 697 | 698 | info-am: 699 | 700 | install-data-am: 701 | 702 | install-dvi: install-dvi-recursive 703 | 704 | install-dvi-am: 705 | 706 | install-exec-am: 707 | 708 | install-html: install-html-recursive 709 | 710 | install-html-am: 711 | 712 | install-info: install-info-recursive 713 | 714 | install-info-am: 715 | 716 | install-man: 717 | 718 | install-pdf: install-pdf-recursive 719 | 720 | install-pdf-am: 721 | 722 | install-ps: install-ps-recursive 723 | 724 | install-ps-am: 725 | 726 | installcheck-am: 727 | 728 | maintainer-clean: maintainer-clean-recursive 729 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 730 | -rm -rf $(top_srcdir)/autom4te.cache 731 | -rm -f Makefile 732 | maintainer-clean-am: distclean-am maintainer-clean-generic 733 | 734 | mostlyclean: mostlyclean-recursive 735 | 736 | mostlyclean-am: mostlyclean-generic 737 | 738 | pdf: pdf-recursive 739 | 740 | pdf-am: 741 | 742 | ps: ps-recursive 743 | 744 | ps-am: 745 | 746 | uninstall-am: 747 | 748 | .MAKE: $(am__recursive_targets) all install-am install-strip 749 | 750 | .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ 751 | am--refresh check check-am clean clean-cscope clean-generic \ 752 | cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ 753 | dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ 754 | distcheck distclean distclean-generic distclean-hdr \ 755 | distclean-tags distcleancheck distdir distuninstallcheck dvi \ 756 | dvi-am html html-am info info-am install install-am \ 757 | install-data install-data-am install-dvi install-dvi-am \ 758 | install-exec install-exec-am install-html install-html-am \ 759 | install-info install-info-am install-man install-pdf \ 760 | install-pdf-am install-ps install-ps-am install-strip \ 761 | installcheck installcheck-am installdirs installdirs-am \ 762 | maintainer-clean maintainer-clean-generic mostlyclean \ 763 | mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ 764 | uninstall-am 765 | 766 | .PRECIOUS: Makefile 767 | 768 | 769 | install: 770 | mkdir -p bin && cp src/bxtools bin 771 | 772 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 773 | # Otherwise a system limit (for SysV at least) may be exceeded. 774 | .NOEXPORT: 775 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/walaj/bxtools.svg?branch=master)](https://travis-ci.org/walaj/bxtools) 2 | 3 | ## *bxtools* - Tools for analyzing 10X genomics data 4 | 5 | **License:** [MIT][license] 6 | 7 | ## Note: *bxtools* is an emerging project. If you find an operation that you need that may be in the scope of *bxtools*, please submit an issue report or pull request with the suggested functionality. We are looking for community suggestions for what we might include. 8 | 9 | Table of contents 10 | ================= 11 | 12 | * [Installation](#installation) 13 | * [Description](#description) 14 | * [Components](#components) 15 | * [Split](#split) 16 | * [Stats](#stats) 17 | * [Tile](#tile) 18 | * [Relabel](#relabel) 19 | * [Mol](#mol) 20 | * [Convert](#convert) 21 | * [Example Recipes](#examples-recipes) 22 | * [Attributions](#attributions) 23 | 24 | Installation 25 | ------------ 26 | 27 | ``` 28 | git clone --recursive https://github.com/walaj/bxtools 29 | cd bxtools 30 | ./configure 31 | make 32 | make install 33 | ``` 34 | 35 | Description 36 | ----------- 37 | *bxtools* is a set of light-weight command line tools for analyzing 10X genomics data. It is built to 38 | take care of low-level type operations in a 10X-specific way by accounting for the BX tag in 10X data. 39 | 40 | Components 41 | ---------- 42 | 43 | #### Split 44 | 45 | Split a BAM file by the BX tag. 46 | 47 | ``` 48 | ## split a BAM into individual BAMs (called test..bam). Don't output tags with < 10 reads 49 | bxtools split $bam -a test -m 10 > counts.tsv 50 | 51 | ## split a portion of a BAM 52 | samtools view -h $bam 1:1,000,000-2,000,000 | bxtools split - -a test > counts.tsv 53 | 54 | ## just get the BX counts and sort by prevalence 55 | bxtools split $bam -x | sort -n -k 2,2 > counts.tsv 56 | ``` 57 | 58 | #### Stats 59 | 60 | Collect BX-level statistics from a 10X BAM 61 | 62 | ``` 63 | bxtools stats $bam > stats.tsv 64 | ## output columns: BX, read count, median insert size, median mapq, median AS. 65 | ``` 66 | 67 | To summarize based on another tag, use `-t`. E.g. : `bxtools stats -t MI $bam` 68 | 69 | 70 | #### Tile 71 | 72 | Collect BX-level read counts on a tiled genome 73 | ``` 74 | ## default is 1kb tiles, across entire genome 75 | bxtools tile $bam > counts.bed 76 | 77 | ## input bed to check (e.g. chr1 only) 78 | samtools view -h $bam 1:1-250,000,000 | bxtools tile - -b chr1.tiles.bed > chr1.tiles.counts.bed 79 | ``` 80 | 81 | #### Relabel 82 | Move the BX barcodes from the ``BX`` tag (e.g. ``BX:ACTTACCGA``) to the read name (e.g. ``qname_ACTTACCGA``) 83 | ``` 84 | VERBOSE=-v ## print progress 85 | bxtools relabel $bam $VERBOSE > relabeled.bam 86 | ``` 87 | 88 | #### Mol 89 | Get the minimum molecular footprint on the genome as BED file for each MI tag. The 90 | minimal footprint is defined from the minimum start position to the maximum end position of 91 | all reads sharing an MI tag. Throws an error message if detects the same MI tag on multiple chromosomes. 92 | 93 | The output BED format is chr, start, end, MI, BX, read_count 94 | ``` 95 | bxtools mol $bam > mol_footprint.bed 96 | ``` 97 | 98 | #### Convert 99 | Switch the alignment chromosome with the BX tag. This is a hack to allow a 10X BAM to be sorted and indexed by BX tag, rather than coordinate. 100 | Useful for rapid lookup of all BX reads from a particular BX. Note that this switches "-" for "_" to make query possible with ``samtools view``. 101 | This also requires a two-pass solution. The first loop is to get all of the unique BX tags to build the new BAM header. The second makes the switches. 102 | This means that streaming from ``stdin`` is not available. 103 | 104 | ``` 105 | bxtools convert $bam | samtools sort - -o bx_sorted.bam 106 | samtools index bx_sorted.bam 107 | samtools view AGTCCAAGTCGGAAGT_1 108 | ``` 109 | 110 | Example recipes 111 | --------------- 112 | #### Get BX level coverage in 2kb bins across genome, ignore low-frequency tags 113 | 114 | ``` 115 | ## make a list of bad tags (freq < 100) 116 | samtools view -h $bam 1:1-10,000,000 | bxtools split - -x | awk '$2 < 100' | cut -f1 > excluded_list.txt 117 | 118 | ## get the coverage, while excluding bad tags (grep: -F literal, -f file, -v exclude) 119 | samtools view -h $bam 1:1-10,000,000 | grep -v -F -f excluded_list.txt | bxtools tile - -w 2000 > bxcov.bed 120 | ``` 121 | 122 | Attributions 123 | ------------ 124 | 125 | This project is developed and maintained by Jeremiah Wala (jwala@broadinstitute.org) 126 | 127 | Analysis suggestions and 10X support 128 | * Tushar Kamath - MD-PhD Student, Harvard Medical School 129 | * Gavin Ha - Postdoctoral Fellow, Broad Institute 130 | * Srinivas Viswanathan - Oncology Fellow, Dana Farber Cancer Institute 131 | * Chris Whelan - Computational Biologist, Broad Institute 132 | * Cheng-Zhong Zhang - Assistant Professor, Dana Farber Cancer Institute 133 | * Marcin Imielinski - Assistant Professor, Weill Cornell Medical College 134 | * Rameen Beroukhim - Assistant Professor, Dana Farber Cancer Institute 135 | * Matthew Meyerson - Professor, Dana Farber Cancer Institute 136 | 137 | [license]: https://github.com/walaj/bxtools/blob/master/LICENSE 138 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | aclocal 5 | autoconf 6 | autoheader 7 | automake -a 8 | -------------------------------------------------------------------------------- /config.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated from config.h.in by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* clock_getttime found */ 5 | #define HAVE_CLOCK_GETTIME 1 6 | 7 | /* Define to 1 if you have the header file. */ 8 | #define HAVE_INTTYPES_H 1 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #define HAVE_MEMORY_H 1 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_STDINT_H 1 15 | 16 | /* Define to 1 if you have the header file. */ 17 | #define HAVE_STDLIB_H 1 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #define HAVE_STRINGS_H 1 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_STRING_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #define HAVE_SYS_STAT_H 1 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_SYS_TYPES_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_UNISTD_H 1 33 | 34 | /* Name of package */ 35 | #define PACKAGE "bxtools" 36 | 37 | /* Define to the address where bug reports for this package should be sent. */ 38 | #define PACKAGE_BUGREPORT "jwala@broadinstitute.org" 39 | 40 | /* Define to the full name of this package. */ 41 | #define PACKAGE_NAME "bxtools" 42 | 43 | /* Define to the full name and version of this package. */ 44 | #define PACKAGE_STRING "bxtools 0.0" 45 | 46 | /* Define to the one symbol short name of this package. */ 47 | #define PACKAGE_TARNAME "bxtools" 48 | 49 | /* Define to the home page for this package. */ 50 | #define PACKAGE_URL "" 51 | 52 | /* Define to the version of this package. */ 53 | #define PACKAGE_VERSION "0.0" 54 | 55 | /* Define to 1 if you have the ANSI C header files. */ 56 | #define STDC_HEADERS 1 57 | 58 | /* Version number of package */ 59 | #define VERSION "0.0" 60 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* clock_getttime found */ 4 | #undef HAVE_CLOCK_GETTIME 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_MEMORY_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_STDINT_H 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_STDLIB_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_STRINGS_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_STRING_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_SYS_STAT_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_SYS_TYPES_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_UNISTD_H 32 | 33 | /* Name of package */ 34 | #undef PACKAGE 35 | 36 | /* Define to the address where bug reports for this package should be sent. */ 37 | #undef PACKAGE_BUGREPORT 38 | 39 | /* Define to the full name of this package. */ 40 | #undef PACKAGE_NAME 41 | 42 | /* Define to the full name and version of this package. */ 43 | #undef PACKAGE_STRING 44 | 45 | /* Define to the one symbol short name of this package. */ 46 | #undef PACKAGE_TARNAME 47 | 48 | /* Define to the home page for this package. */ 49 | #undef PACKAGE_URL 50 | 51 | /* Define to the version of this package. */ 52 | #undef PACKAGE_VERSION 53 | 54 | /* Define to 1 if you have the ANSI C header files. */ 55 | #undef STDC_HEADERS 56 | 57 | /* Version number of package */ 58 | #undef VERSION 59 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | # Process this file with autoconf to produce a configure script. 2 | AC_PREREQ(2.59) ## specificy version of autoconf 3 | AC_INIT(bxtools, 0.0, jwala@broadinstitute.org) 4 | AM_INIT_AUTOMAKE(foreign) 5 | AC_CONFIG_SRCDIR([src/bxtools.cpp]) 6 | AC_CONFIG_HEADER([config.h]) 7 | AM_MAINTAINER_MODE([disable]) 8 | 9 | # Checks for programs. 10 | AC_PROG_CXX ## test for cpp compiler 11 | AC_PROG_CC ## test for C compiler 12 | AC_PROG_RANLIB ## required if libraries are built in package 13 | 14 | # Check for headers 15 | AC_LANG([C++]) 16 | AC_CHECK_HEADER([zlib.h]) 17 | 18 | # Check for libraries 19 | ##AC_SEARCH_LIBS([library],[function], [action-if-found], [action if not found]) 20 | AC_SEARCH_LIBS([gzopen],[z],,[AC_MSG_ERROR([libz not found, please install zlib (http://www.zlib.net/)])]) 21 | AC_SEARCH_LIBS([lzma_end],[lzma],,[AC_MSG_ERROR([liblzma not found, please install lzma])]) 22 | AC_SEARCH_LIBS([BZ2_bzBuffToBuffCompress],[bz2],,[AC_MSG_ERROR([libbz2 not found, please install bz2])]) 23 | AC_SEARCH_LIBS([clock_gettime], [rt], [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [clock_getttime found])], ) 24 | 25 | # Only fail on warnings when the --enable-development flag is passed into configure 26 | AC_ARG_ENABLE(development, AS_HELP_STRING([--enable-development], 27 | [Turn on development options, like failing compilation on warnings])) 28 | if test "$enable_development"; then 29 | fail_on_warning="-Werror" 30 | fi 31 | 32 | # Set compiler flags. 33 | AC_SUBST(AM_CXXFLAGS, "-std=c++11 -Wall -Wextra $fail_on_warning -Wno-unknown-pragmas") 34 | ##AC_SUBST(AM_CXXFLAGS, "-Wall -Wextra $fail_on_warning -Wno-unknown-pragmas") 35 | ##AC_SUBST(CXXFLAGS, "$CXXFLAGS") 36 | ##AC_SUBST(CFLAGS, "$CFLAGS") 37 | ##AC_SUBST(CPPFLAGS, "$CPPFLAGS $boost_include") 38 | ## pthread required for htslib to link 39 | AC_SUBST(LDFLAGS, "$LDFLAGS -pthread") 40 | ##AC_SUBST(LIBS, "$LIBS") 41 | 42 | AC_CONFIG_FILES([Makefile 43 | SeqLib/src/Makefile 44 | src/Makefile]) 45 | 46 | AC_OUTPUT 47 | -------------------------------------------------------------------------------- /depcomp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # depcomp - compile a program generating dependencies as side-effects 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free 7 | # Software Foundation, Inc. 8 | 9 | # This program is free software; you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 2, or (at your option) 12 | # any later version. 13 | 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | # Originally written by Alexandre Oliva . 28 | 29 | case $1 in 30 | '') 31 | echo "$0: No command. Try \`$0 --help' for more information." 1>&2 32 | exit 1; 33 | ;; 34 | -h | --h*) 35 | cat <<\EOF 36 | Usage: depcomp [--help] [--version] PROGRAM [ARGS] 37 | 38 | Run PROGRAMS ARGS to compile a file, generating dependencies 39 | as side-effects. 40 | 41 | Environment variables: 42 | depmode Dependency tracking mode. 43 | source Source file read by `PROGRAMS ARGS'. 44 | object Object file output by `PROGRAMS ARGS'. 45 | DEPDIR directory where to store dependencies. 46 | depfile Dependency file to output. 47 | tmpdepfile Temporary file to use when outputing dependencies. 48 | libtool Whether libtool is used (yes/no). 49 | 50 | Report bugs to . 51 | EOF 52 | exit $? 53 | ;; 54 | -v | --v*) 55 | echo "depcomp $scriptversion" 56 | exit $? 57 | ;; 58 | esac 59 | 60 | if test -z "$depmode" || test -z "$source" || test -z "$object"; then 61 | echo "depcomp: Variables source, object and depmode must be set" 1>&2 62 | exit 1 63 | fi 64 | 65 | # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. 66 | depfile=${depfile-`echo "$object" | 67 | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} 68 | tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} 69 | 70 | rm -f "$tmpdepfile" 71 | 72 | # Some modes work just like other modes, but use different flags. We 73 | # parameterize here, but still list the modes in the big case below, 74 | # to make depend.m4 easier to write. Note that we *cannot* use a case 75 | # here, because this file can only contain one case statement. 76 | if test "$depmode" = hp; then 77 | # HP compiler uses -M and no extra arg. 78 | gccflag=-M 79 | depmode=gcc 80 | fi 81 | 82 | if test "$depmode" = dashXmstdout; then 83 | # This is just like dashmstdout with a different argument. 84 | dashmflag=-xM 85 | depmode=dashmstdout 86 | fi 87 | 88 | cygpath_u="cygpath -u -f -" 89 | if test "$depmode" = msvcmsys; then 90 | # This is just like msvisualcpp but w/o cygpath translation. 91 | # Just convert the backslash-escaped backslashes to single forward 92 | # slashes to satisfy depend.m4 93 | cygpath_u="sed s,\\\\\\\\,/,g" 94 | depmode=msvisualcpp 95 | fi 96 | 97 | case "$depmode" in 98 | gcc3) 99 | ## gcc 3 implements dependency tracking that does exactly what 100 | ## we want. Yay! Note: for some reason libtool 1.4 doesn't like 101 | ## it if -MD -MP comes after the -MF stuff. Hmm. 102 | ## Unfortunately, FreeBSD c89 acceptance of flags depends upon 103 | ## the command line argument order; so add the flags where they 104 | ## appear in depend2.am. Note that the slowdown incurred here 105 | ## affects only configure: in makefiles, %FASTDEP% shortcuts this. 106 | for arg 107 | do 108 | case $arg in 109 | -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; 110 | *) set fnord "$@" "$arg" ;; 111 | esac 112 | shift # fnord 113 | shift # $arg 114 | done 115 | "$@" 116 | stat=$? 117 | if test $stat -eq 0; then : 118 | else 119 | rm -f "$tmpdepfile" 120 | exit $stat 121 | fi 122 | mv "$tmpdepfile" "$depfile" 123 | ;; 124 | 125 | gcc) 126 | ## There are various ways to get dependency output from gcc. Here's 127 | ## why we pick this rather obscure method: 128 | ## - Don't want to use -MD because we'd like the dependencies to end 129 | ## up in a subdir. Having to rename by hand is ugly. 130 | ## (We might end up doing this anyway to support other compilers.) 131 | ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like 132 | ## -MM, not -M (despite what the docs say). 133 | ## - Using -M directly means running the compiler twice (even worse 134 | ## than renaming). 135 | if test -z "$gccflag"; then 136 | gccflag=-MD, 137 | fi 138 | "$@" -Wp,"$gccflag$tmpdepfile" 139 | stat=$? 140 | if test $stat -eq 0; then : 141 | else 142 | rm -f "$tmpdepfile" 143 | exit $stat 144 | fi 145 | rm -f "$depfile" 146 | echo "$object : \\" > "$depfile" 147 | alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 148 | ## The second -e expression handles DOS-style file names with drive letters. 149 | sed -e 's/^[^:]*: / /' \ 150 | -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" 151 | ## This next piece of magic avoids the `deleted header file' problem. 152 | ## The problem is that when a header file which appears in a .P file 153 | ## is deleted, the dependency causes make to die (because there is 154 | ## typically no way to rebuild the header). We avoid this by adding 155 | ## dummy dependencies for each header file. Too bad gcc doesn't do 156 | ## this for us directly. 157 | tr ' ' ' 158 | ' < "$tmpdepfile" | 159 | ## Some versions of gcc put a space before the `:'. On the theory 160 | ## that the space means something, we add a space to the output as 161 | ## well. 162 | ## Some versions of the HPUX 10.20 sed can't process this invocation 163 | ## correctly. Breaking it into two sed invocations is a workaround. 164 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 165 | rm -f "$tmpdepfile" 166 | ;; 167 | 168 | hp) 169 | # This case exists only to let depend.m4 do its work. It works by 170 | # looking at the text of this script. This case will never be run, 171 | # since it is checked for above. 172 | exit 1 173 | ;; 174 | 175 | sgi) 176 | if test "$libtool" = yes; then 177 | "$@" "-Wp,-MDupdate,$tmpdepfile" 178 | else 179 | "$@" -MDupdate "$tmpdepfile" 180 | fi 181 | stat=$? 182 | if test $stat -eq 0; then : 183 | else 184 | rm -f "$tmpdepfile" 185 | exit $stat 186 | fi 187 | rm -f "$depfile" 188 | 189 | if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files 190 | echo "$object : \\" > "$depfile" 191 | 192 | # Clip off the initial element (the dependent). Don't try to be 193 | # clever and replace this with sed code, as IRIX sed won't handle 194 | # lines with more than a fixed number of characters (4096 in 195 | # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; 196 | # the IRIX cc adds comments like `#:fec' to the end of the 197 | # dependency line. 198 | tr ' ' ' 199 | ' < "$tmpdepfile" \ 200 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ 201 | tr ' 202 | ' ' ' >> "$depfile" 203 | echo >> "$depfile" 204 | 205 | # The second pass generates a dummy entry for each header file. 206 | tr ' ' ' 207 | ' < "$tmpdepfile" \ 208 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ 209 | >> "$depfile" 210 | else 211 | # The sourcefile does not contain any dependencies, so just 212 | # store a dummy comment line, to avoid errors with the Makefile 213 | # "include basename.Plo" scheme. 214 | echo "#dummy" > "$depfile" 215 | fi 216 | rm -f "$tmpdepfile" 217 | ;; 218 | 219 | aix) 220 | # The C for AIX Compiler uses -M and outputs the dependencies 221 | # in a .u file. In older versions, this file always lives in the 222 | # current directory. Also, the AIX compiler puts `$object:' at the 223 | # start of each line; $object doesn't have directory information. 224 | # Version 6 uses the directory in both cases. 225 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 226 | test "x$dir" = "x$object" && dir= 227 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 228 | if test "$libtool" = yes; then 229 | tmpdepfile1=$dir$base.u 230 | tmpdepfile2=$base.u 231 | tmpdepfile3=$dir.libs/$base.u 232 | "$@" -Wc,-M 233 | else 234 | tmpdepfile1=$dir$base.u 235 | tmpdepfile2=$dir$base.u 236 | tmpdepfile3=$dir$base.u 237 | "$@" -M 238 | fi 239 | stat=$? 240 | 241 | if test $stat -eq 0; then : 242 | else 243 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 244 | exit $stat 245 | fi 246 | 247 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 248 | do 249 | test -f "$tmpdepfile" && break 250 | done 251 | if test -f "$tmpdepfile"; then 252 | # Each line is of the form `foo.o: dependent.h'. 253 | # Do two passes, one to just change these to 254 | # `$object: dependent.h' and one to simply `dependent.h:'. 255 | sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 256 | # That's a tab and a space in the []. 257 | sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 258 | else 259 | # The sourcefile does not contain any dependencies, so just 260 | # store a dummy comment line, to avoid errors with the Makefile 261 | # "include basename.Plo" scheme. 262 | echo "#dummy" > "$depfile" 263 | fi 264 | rm -f "$tmpdepfile" 265 | ;; 266 | 267 | icc) 268 | # Intel's C compiler understands `-MD -MF file'. However on 269 | # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c 270 | # ICC 7.0 will fill foo.d with something like 271 | # foo.o: sub/foo.c 272 | # foo.o: sub/foo.h 273 | # which is wrong. We want: 274 | # sub/foo.o: sub/foo.c 275 | # sub/foo.o: sub/foo.h 276 | # sub/foo.c: 277 | # sub/foo.h: 278 | # ICC 7.1 will output 279 | # foo.o: sub/foo.c sub/foo.h 280 | # and will wrap long lines using \ : 281 | # foo.o: sub/foo.c ... \ 282 | # sub/foo.h ... \ 283 | # ... 284 | 285 | "$@" -MD -MF "$tmpdepfile" 286 | stat=$? 287 | if test $stat -eq 0; then : 288 | else 289 | rm -f "$tmpdepfile" 290 | exit $stat 291 | fi 292 | rm -f "$depfile" 293 | # Each line is of the form `foo.o: dependent.h', 294 | # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. 295 | # Do two passes, one to just change these to 296 | # `$object: dependent.h' and one to simply `dependent.h:'. 297 | sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" 298 | # Some versions of the HPUX 10.20 sed can't process this invocation 299 | # correctly. Breaking it into two sed invocations is a workaround. 300 | sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | 301 | sed -e 's/$/ :/' >> "$depfile" 302 | rm -f "$tmpdepfile" 303 | ;; 304 | 305 | hp2) 306 | # The "hp" stanza above does not work with aCC (C++) and HP's ia64 307 | # compilers, which have integrated preprocessors. The correct option 308 | # to use with these is +Maked; it writes dependencies to a file named 309 | # 'foo.d', which lands next to the object file, wherever that 310 | # happens to be. 311 | # Much of this is similar to the tru64 case; see comments there. 312 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 313 | test "x$dir" = "x$object" && dir= 314 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 315 | if test "$libtool" = yes; then 316 | tmpdepfile1=$dir$base.d 317 | tmpdepfile2=$dir.libs/$base.d 318 | "$@" -Wc,+Maked 319 | else 320 | tmpdepfile1=$dir$base.d 321 | tmpdepfile2=$dir$base.d 322 | "$@" +Maked 323 | fi 324 | stat=$? 325 | if test $stat -eq 0; then : 326 | else 327 | rm -f "$tmpdepfile1" "$tmpdepfile2" 328 | exit $stat 329 | fi 330 | 331 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" 332 | do 333 | test -f "$tmpdepfile" && break 334 | done 335 | if test -f "$tmpdepfile"; then 336 | sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" 337 | # Add `dependent.h:' lines. 338 | sed -ne '2,${ 339 | s/^ *// 340 | s/ \\*$// 341 | s/$/:/ 342 | p 343 | }' "$tmpdepfile" >> "$depfile" 344 | else 345 | echo "#dummy" > "$depfile" 346 | fi 347 | rm -f "$tmpdepfile" "$tmpdepfile2" 348 | ;; 349 | 350 | tru64) 351 | # The Tru64 compiler uses -MD to generate dependencies as a side 352 | # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. 353 | # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 354 | # dependencies in `foo.d' instead, so we check for that too. 355 | # Subdirectories are respected. 356 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 357 | test "x$dir" = "x$object" && dir= 358 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 359 | 360 | if test "$libtool" = yes; then 361 | # With Tru64 cc, shared objects can also be used to make a 362 | # static library. This mechanism is used in libtool 1.4 series to 363 | # handle both shared and static libraries in a single compilation. 364 | # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. 365 | # 366 | # With libtool 1.5 this exception was removed, and libtool now 367 | # generates 2 separate objects for the 2 libraries. These two 368 | # compilations output dependencies in $dir.libs/$base.o.d and 369 | # in $dir$base.o.d. We have to check for both files, because 370 | # one of the two compilations can be disabled. We should prefer 371 | # $dir$base.o.d over $dir.libs/$base.o.d because the latter is 372 | # automatically cleaned when .libs/ is deleted, while ignoring 373 | # the former would cause a distcleancheck panic. 374 | tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 375 | tmpdepfile2=$dir$base.o.d # libtool 1.5 376 | tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 377 | tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 378 | "$@" -Wc,-MD 379 | else 380 | tmpdepfile1=$dir$base.o.d 381 | tmpdepfile2=$dir$base.d 382 | tmpdepfile3=$dir$base.d 383 | tmpdepfile4=$dir$base.d 384 | "$@" -MD 385 | fi 386 | 387 | stat=$? 388 | if test $stat -eq 0; then : 389 | else 390 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 391 | exit $stat 392 | fi 393 | 394 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 395 | do 396 | test -f "$tmpdepfile" && break 397 | done 398 | if test -f "$tmpdepfile"; then 399 | sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 400 | # That's a tab and a space in the []. 401 | sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 402 | else 403 | echo "#dummy" > "$depfile" 404 | fi 405 | rm -f "$tmpdepfile" 406 | ;; 407 | 408 | #nosideeffect) 409 | # This comment above is used by automake to tell side-effect 410 | # dependency tracking mechanisms from slower ones. 411 | 412 | dashmstdout) 413 | # Important note: in order to support this mode, a compiler *must* 414 | # always write the preprocessed file to stdout, regardless of -o. 415 | "$@" || exit $? 416 | 417 | # Remove the call to Libtool. 418 | if test "$libtool" = yes; then 419 | while test "X$1" != 'X--mode=compile'; do 420 | shift 421 | done 422 | shift 423 | fi 424 | 425 | # Remove `-o $object'. 426 | IFS=" " 427 | for arg 428 | do 429 | case $arg in 430 | -o) 431 | shift 432 | ;; 433 | $object) 434 | shift 435 | ;; 436 | *) 437 | set fnord "$@" "$arg" 438 | shift # fnord 439 | shift # $arg 440 | ;; 441 | esac 442 | done 443 | 444 | test -z "$dashmflag" && dashmflag=-M 445 | # Require at least two characters before searching for `:' 446 | # in the target name. This is to cope with DOS-style filenames: 447 | # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. 448 | "$@" $dashmflag | 449 | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" 450 | rm -f "$depfile" 451 | cat < "$tmpdepfile" > "$depfile" 452 | tr ' ' ' 453 | ' < "$tmpdepfile" | \ 454 | ## Some versions of the HPUX 10.20 sed can't process this invocation 455 | ## correctly. Breaking it into two sed invocations is a workaround. 456 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 457 | rm -f "$tmpdepfile" 458 | ;; 459 | 460 | dashXmstdout) 461 | # This case only exists to satisfy depend.m4. It is never actually 462 | # run, as this mode is specially recognized in the preamble. 463 | exit 1 464 | ;; 465 | 466 | makedepend) 467 | "$@" || exit $? 468 | # Remove any Libtool call 469 | if test "$libtool" = yes; then 470 | while test "X$1" != 'X--mode=compile'; do 471 | shift 472 | done 473 | shift 474 | fi 475 | # X makedepend 476 | shift 477 | cleared=no eat=no 478 | for arg 479 | do 480 | case $cleared in 481 | no) 482 | set ""; shift 483 | cleared=yes ;; 484 | esac 485 | if test $eat = yes; then 486 | eat=no 487 | continue 488 | fi 489 | case "$arg" in 490 | -D*|-I*) 491 | set fnord "$@" "$arg"; shift ;; 492 | # Strip any option that makedepend may not understand. Remove 493 | # the object too, otherwise makedepend will parse it as a source file. 494 | -arch) 495 | eat=yes ;; 496 | -*|$object) 497 | ;; 498 | *) 499 | set fnord "$@" "$arg"; shift ;; 500 | esac 501 | done 502 | obj_suffix=`echo "$object" | sed 's/^.*\././'` 503 | touch "$tmpdepfile" 504 | ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" 505 | rm -f "$depfile" 506 | cat < "$tmpdepfile" > "$depfile" 507 | sed '1,2d' "$tmpdepfile" | tr ' ' ' 508 | ' | \ 509 | ## Some versions of the HPUX 10.20 sed can't process this invocation 510 | ## correctly. Breaking it into two sed invocations is a workaround. 511 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 512 | rm -f "$tmpdepfile" "$tmpdepfile".bak 513 | ;; 514 | 515 | cpp) 516 | # Important note: in order to support this mode, a compiler *must* 517 | # always write the preprocessed file to stdout. 518 | "$@" || exit $? 519 | 520 | # Remove the call to Libtool. 521 | if test "$libtool" = yes; then 522 | while test "X$1" != 'X--mode=compile'; do 523 | shift 524 | done 525 | shift 526 | fi 527 | 528 | # Remove `-o $object'. 529 | IFS=" " 530 | for arg 531 | do 532 | case $arg in 533 | -o) 534 | shift 535 | ;; 536 | $object) 537 | shift 538 | ;; 539 | *) 540 | set fnord "$@" "$arg" 541 | shift # fnord 542 | shift # $arg 543 | ;; 544 | esac 545 | done 546 | 547 | "$@" -E | 548 | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 549 | -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | 550 | sed '$ s: \\$::' > "$tmpdepfile" 551 | rm -f "$depfile" 552 | echo "$object : \\" > "$depfile" 553 | cat < "$tmpdepfile" >> "$depfile" 554 | sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" 555 | rm -f "$tmpdepfile" 556 | ;; 557 | 558 | msvisualcpp) 559 | # Important note: in order to support this mode, a compiler *must* 560 | # always write the preprocessed file to stdout. 561 | "$@" || exit $? 562 | 563 | # Remove the call to Libtool. 564 | if test "$libtool" = yes; then 565 | while test "X$1" != 'X--mode=compile'; do 566 | shift 567 | done 568 | shift 569 | fi 570 | 571 | IFS=" " 572 | for arg 573 | do 574 | case "$arg" in 575 | -o) 576 | shift 577 | ;; 578 | $object) 579 | shift 580 | ;; 581 | "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") 582 | set fnord "$@" 583 | shift 584 | shift 585 | ;; 586 | *) 587 | set fnord "$@" "$arg" 588 | shift 589 | shift 590 | ;; 591 | esac 592 | done 593 | "$@" -E 2>/dev/null | 594 | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" 595 | rm -f "$depfile" 596 | echo "$object : \\" > "$depfile" 597 | sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" 598 | echo " " >> "$depfile" 599 | sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" 600 | rm -f "$tmpdepfile" 601 | ;; 602 | 603 | msvcmsys) 604 | # This case exists only to let depend.m4 do its work. It works by 605 | # looking at the text of this script. This case will never be run, 606 | # since it is checked for above. 607 | exit 1 608 | ;; 609 | 610 | none) 611 | exec "$@" 612 | ;; 613 | 614 | *) 615 | echo "Unknown depmode $depmode" 1>&2 616 | exit 1 617 | ;; 618 | esac 619 | 620 | exit 0 621 | 622 | # Local Variables: 623 | # mode: shell-script 624 | # sh-indentation: 2 625 | # eval: (add-hook 'write-file-hooks 'time-stamp) 626 | # time-stamp-start: "scriptversion=" 627 | # time-stamp-format: "%:y-%02m-%02d.%02H" 628 | # time-stamp-time-zone: "UTC" 629 | # time-stamp-end: "; # UTC" 630 | # End: 631 | -------------------------------------------------------------------------------- /install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # install - install a program, script, or datafile 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # This originates from X11R5 (mit/util/scripts/install.sh), which was 7 | # later released in X11R6 (xc/config/util/install.sh) with the 8 | # following copyright and license. 9 | # 10 | # Copyright (C) 1994 X Consortium 11 | # 12 | # Permission is hereby granted, free of charge, to any person obtaining a copy 13 | # of this software and associated documentation files (the "Software"), to 14 | # deal in the Software without restriction, including without limitation the 15 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 16 | # sell copies of the Software, and to permit persons to whom the Software is 17 | # furnished to do so, subject to the following conditions: 18 | # 19 | # The above copyright notice and this permission notice shall be included in 20 | # all copies or substantial portions of the Software. 21 | # 22 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26 | # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- 27 | # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name of the X Consortium shall not 30 | # be used in advertising or otherwise to promote the sale, use or other deal- 31 | # ings in this Software without prior written authorization from the X Consor- 32 | # tium. 33 | # 34 | # 35 | # FSF changes to this file are in the public domain. 36 | # 37 | # Calling this script install-sh is preferred over install.sh, to prevent 38 | # `make' implicit rules from creating a file called install from it 39 | # when there is no Makefile. 40 | # 41 | # This script is compatible with the BSD install script, but was written 42 | # from scratch. 43 | 44 | nl=' 45 | ' 46 | IFS=" "" $nl" 47 | 48 | # set DOITPROG to echo to test this script 49 | 50 | # Don't use :- since 4.3BSD and earlier shells don't like it. 51 | doit=${DOITPROG-} 52 | if test -z "$doit"; then 53 | doit_exec=exec 54 | else 55 | doit_exec=$doit 56 | fi 57 | 58 | # Put in absolute file names if you don't have them in your path; 59 | # or use environment vars. 60 | 61 | chgrpprog=${CHGRPPROG-chgrp} 62 | chmodprog=${CHMODPROG-chmod} 63 | chownprog=${CHOWNPROG-chown} 64 | cmpprog=${CMPPROG-cmp} 65 | cpprog=${CPPROG-cp} 66 | mkdirprog=${MKDIRPROG-mkdir} 67 | mvprog=${MVPROG-mv} 68 | rmprog=${RMPROG-rm} 69 | stripprog=${STRIPPROG-strip} 70 | 71 | posix_glob='?' 72 | initialize_posix_glob=' 73 | test "$posix_glob" != "?" || { 74 | if (set -f) 2>/dev/null; then 75 | posix_glob= 76 | else 77 | posix_glob=: 78 | fi 79 | } 80 | ' 81 | 82 | posix_mkdir= 83 | 84 | # Desired mode of installed file. 85 | mode=0755 86 | 87 | chgrpcmd= 88 | chmodcmd=$chmodprog 89 | chowncmd= 90 | mvcmd=$mvprog 91 | rmcmd="$rmprog -f" 92 | stripcmd= 93 | 94 | src= 95 | dst= 96 | dir_arg= 97 | dst_arg= 98 | 99 | copy_on_change=false 100 | no_target_directory= 101 | 102 | usage="\ 103 | Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE 104 | or: $0 [OPTION]... SRCFILES... DIRECTORY 105 | or: $0 [OPTION]... -t DIRECTORY SRCFILES... 106 | or: $0 [OPTION]... -d DIRECTORIES... 107 | 108 | In the 1st form, copy SRCFILE to DSTFILE. 109 | In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. 110 | In the 4th, create DIRECTORIES. 111 | 112 | Options: 113 | --help display this help and exit. 114 | --version display version info and exit. 115 | 116 | -c (ignored) 117 | -C install only if different (preserve the last data modification time) 118 | -d create directories instead of installing files. 119 | -g GROUP $chgrpprog installed files to GROUP. 120 | -m MODE $chmodprog installed files to MODE. 121 | -o USER $chownprog installed files to USER. 122 | -s $stripprog installed files. 123 | -t DIRECTORY install into DIRECTORY. 124 | -T report an error if DSTFILE is a directory. 125 | 126 | Environment variables override the default commands: 127 | CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG 128 | RMPROG STRIPPROG 129 | " 130 | 131 | while test $# -ne 0; do 132 | case $1 in 133 | -c) ;; 134 | 135 | -C) copy_on_change=true;; 136 | 137 | -d) dir_arg=true;; 138 | 139 | -g) chgrpcmd="$chgrpprog $2" 140 | shift;; 141 | 142 | --help) echo "$usage"; exit $?;; 143 | 144 | -m) mode=$2 145 | case $mode in 146 | *' '* | *' '* | *' 147 | '* | *'*'* | *'?'* | *'['*) 148 | echo "$0: invalid mode: $mode" >&2 149 | exit 1;; 150 | esac 151 | shift;; 152 | 153 | -o) chowncmd="$chownprog $2" 154 | shift;; 155 | 156 | -s) stripcmd=$stripprog;; 157 | 158 | -t) dst_arg=$2 159 | shift;; 160 | 161 | -T) no_target_directory=true;; 162 | 163 | --version) echo "$0 $scriptversion"; exit $?;; 164 | 165 | --) shift 166 | break;; 167 | 168 | -*) echo "$0: invalid option: $1" >&2 169 | exit 1;; 170 | 171 | *) break;; 172 | esac 173 | shift 174 | done 175 | 176 | if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then 177 | # When -d is used, all remaining arguments are directories to create. 178 | # When -t is used, the destination is already specified. 179 | # Otherwise, the last argument is the destination. Remove it from $@. 180 | for arg 181 | do 182 | if test -n "$dst_arg"; then 183 | # $@ is not empty: it contains at least $arg. 184 | set fnord "$@" "$dst_arg" 185 | shift # fnord 186 | fi 187 | shift # arg 188 | dst_arg=$arg 189 | done 190 | fi 191 | 192 | if test $# -eq 0; then 193 | if test -z "$dir_arg"; then 194 | echo "$0: no input file specified." >&2 195 | exit 1 196 | fi 197 | # It's OK to call `install-sh -d' without argument. 198 | # This can happen when creating conditional directories. 199 | exit 0 200 | fi 201 | 202 | if test -z "$dir_arg"; then 203 | trap '(exit $?); exit' 1 2 13 15 204 | 205 | # Set umask so as not to create temps with too-generous modes. 206 | # However, 'strip' requires both read and write access to temps. 207 | case $mode in 208 | # Optimize common cases. 209 | *644) cp_umask=133;; 210 | *755) cp_umask=22;; 211 | 212 | *[0-7]) 213 | if test -z "$stripcmd"; then 214 | u_plus_rw= 215 | else 216 | u_plus_rw='% 200' 217 | fi 218 | cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; 219 | *) 220 | if test -z "$stripcmd"; then 221 | u_plus_rw= 222 | else 223 | u_plus_rw=,u+rw 224 | fi 225 | cp_umask=$mode$u_plus_rw;; 226 | esac 227 | fi 228 | 229 | for src 230 | do 231 | # Protect names starting with `-'. 232 | case $src in 233 | -*) src=./$src;; 234 | esac 235 | 236 | if test -n "$dir_arg"; then 237 | dst=$src 238 | dstdir=$dst 239 | test -d "$dstdir" 240 | dstdir_status=$? 241 | else 242 | 243 | # Waiting for this to be detected by the "$cpprog $src $dsttmp" command 244 | # might cause directories to be created, which would be especially bad 245 | # if $src (and thus $dsttmp) contains '*'. 246 | if test ! -f "$src" && test ! -d "$src"; then 247 | echo "$0: $src does not exist." >&2 248 | exit 1 249 | fi 250 | 251 | if test -z "$dst_arg"; then 252 | echo "$0: no destination specified." >&2 253 | exit 1 254 | fi 255 | 256 | dst=$dst_arg 257 | # Protect names starting with `-'. 258 | case $dst in 259 | -*) dst=./$dst;; 260 | esac 261 | 262 | # If destination is a directory, append the input filename; won't work 263 | # if double slashes aren't ignored. 264 | if test -d "$dst"; then 265 | if test -n "$no_target_directory"; then 266 | echo "$0: $dst_arg: Is a directory" >&2 267 | exit 1 268 | fi 269 | dstdir=$dst 270 | dst=$dstdir/`basename "$src"` 271 | dstdir_status=0 272 | else 273 | # Prefer dirname, but fall back on a substitute if dirname fails. 274 | dstdir=` 275 | (dirname "$dst") 2>/dev/null || 276 | expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 277 | X"$dst" : 'X\(//\)[^/]' \| \ 278 | X"$dst" : 'X\(//\)$' \| \ 279 | X"$dst" : 'X\(/\)' \| . 2>/dev/null || 280 | echo X"$dst" | 281 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ 282 | s//\1/ 283 | q 284 | } 285 | /^X\(\/\/\)[^/].*/{ 286 | s//\1/ 287 | q 288 | } 289 | /^X\(\/\/\)$/{ 290 | s//\1/ 291 | q 292 | } 293 | /^X\(\/\).*/{ 294 | s//\1/ 295 | q 296 | } 297 | s/.*/./; q' 298 | ` 299 | 300 | test -d "$dstdir" 301 | dstdir_status=$? 302 | fi 303 | fi 304 | 305 | obsolete_mkdir_used=false 306 | 307 | if test $dstdir_status != 0; then 308 | case $posix_mkdir in 309 | '') 310 | # Create intermediate dirs using mode 755 as modified by the umask. 311 | # This is like FreeBSD 'install' as of 1997-10-28. 312 | umask=`umask` 313 | case $stripcmd.$umask in 314 | # Optimize common cases. 315 | *[2367][2367]) mkdir_umask=$umask;; 316 | .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; 317 | 318 | *[0-7]) 319 | mkdir_umask=`expr $umask + 22 \ 320 | - $umask % 100 % 40 + $umask % 20 \ 321 | - $umask % 10 % 4 + $umask % 2 322 | `;; 323 | *) mkdir_umask=$umask,go-w;; 324 | esac 325 | 326 | # With -d, create the new directory with the user-specified mode. 327 | # Otherwise, rely on $mkdir_umask. 328 | if test -n "$dir_arg"; then 329 | mkdir_mode=-m$mode 330 | else 331 | mkdir_mode= 332 | fi 333 | 334 | posix_mkdir=false 335 | case $umask in 336 | *[123567][0-7][0-7]) 337 | # POSIX mkdir -p sets u+wx bits regardless of umask, which 338 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. 339 | ;; 340 | *) 341 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ 342 | trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 343 | 344 | if (umask $mkdir_umask && 345 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 346 | then 347 | if test -z "$dir_arg" || { 348 | # Check for POSIX incompatibilities with -m. 349 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or 350 | # other-writeable bit of parent directory when it shouldn't. 351 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. 352 | ls_ld_tmpdir=`ls -ld "$tmpdir"` 353 | case $ls_ld_tmpdir in 354 | d????-?r-*) different_mode=700;; 355 | d????-?--*) different_mode=755;; 356 | *) false;; 357 | esac && 358 | $mkdirprog -m$different_mode -p -- "$tmpdir" && { 359 | ls_ld_tmpdir_1=`ls -ld "$tmpdir"` 360 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" 361 | } 362 | } 363 | then posix_mkdir=: 364 | fi 365 | rmdir "$tmpdir/d" "$tmpdir" 366 | else 367 | # Remove any dirs left behind by ancient mkdir implementations. 368 | rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null 369 | fi 370 | trap '' 0;; 371 | esac;; 372 | esac 373 | 374 | if 375 | $posix_mkdir && ( 376 | umask $mkdir_umask && 377 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" 378 | ) 379 | then : 380 | else 381 | 382 | # The umask is ridiculous, or mkdir does not conform to POSIX, 383 | # or it failed possibly due to a race condition. Create the 384 | # directory the slow way, step by step, checking for races as we go. 385 | 386 | case $dstdir in 387 | /*) prefix='/';; 388 | -*) prefix='./';; 389 | *) prefix='';; 390 | esac 391 | 392 | eval "$initialize_posix_glob" 393 | 394 | oIFS=$IFS 395 | IFS=/ 396 | $posix_glob set -f 397 | set fnord $dstdir 398 | shift 399 | $posix_glob set +f 400 | IFS=$oIFS 401 | 402 | prefixes= 403 | 404 | for d 405 | do 406 | test -z "$d" && continue 407 | 408 | prefix=$prefix$d 409 | if test -d "$prefix"; then 410 | prefixes= 411 | else 412 | if $posix_mkdir; then 413 | (umask=$mkdir_umask && 414 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break 415 | # Don't fail if two instances are running concurrently. 416 | test -d "$prefix" || exit 1 417 | else 418 | case $prefix in 419 | *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; 420 | *) qprefix=$prefix;; 421 | esac 422 | prefixes="$prefixes '$qprefix'" 423 | fi 424 | fi 425 | prefix=$prefix/ 426 | done 427 | 428 | if test -n "$prefixes"; then 429 | # Don't fail if two instances are running concurrently. 430 | (umask $mkdir_umask && 431 | eval "\$doit_exec \$mkdirprog $prefixes") || 432 | test -d "$dstdir" || exit 1 433 | obsolete_mkdir_used=true 434 | fi 435 | fi 436 | fi 437 | 438 | if test -n "$dir_arg"; then 439 | { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && 440 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && 441 | { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || 442 | test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 443 | else 444 | 445 | # Make a couple of temp file names in the proper directory. 446 | dsttmp=$dstdir/_inst.$$_ 447 | rmtmp=$dstdir/_rm.$$_ 448 | 449 | # Trap to clean up those temp files at exit. 450 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 451 | 452 | # Copy the file name to the temp name. 453 | (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && 454 | 455 | # and set any options; do chmod last to preserve setuid bits. 456 | # 457 | # If any of these fail, we abort the whole thing. If we want to 458 | # ignore errors from any of these, just make sure not to ignore 459 | # errors from the above "$doit $cpprog $src $dsttmp" command. 460 | # 461 | { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && 462 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && 463 | { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && 464 | { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && 465 | 466 | # If -C, don't bother to copy if it wouldn't change the file. 467 | if $copy_on_change && 468 | old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && 469 | new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && 470 | 471 | eval "$initialize_posix_glob" && 472 | $posix_glob set -f && 473 | set X $old && old=:$2:$4:$5:$6 && 474 | set X $new && new=:$2:$4:$5:$6 && 475 | $posix_glob set +f && 476 | 477 | test "$old" = "$new" && 478 | $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 479 | then 480 | rm -f "$dsttmp" 481 | else 482 | # Rename the file to the real destination. 483 | $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || 484 | 485 | # The rename failed, perhaps because mv can't rename something else 486 | # to itself, or perhaps because mv is so ancient that it does not 487 | # support -f. 488 | { 489 | # Now remove or move aside any old file at destination location. 490 | # We try this two ways since rm can't unlink itself on some 491 | # systems and the destination file might be busy for other 492 | # reasons. In this case, the final cleanup might fail but the new 493 | # file should still install successfully. 494 | { 495 | test ! -f "$dst" || 496 | $doit $rmcmd -f "$dst" 2>/dev/null || 497 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && 498 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } 499 | } || 500 | { echo "$0: cannot unlink or rename $dst" >&2 501 | (exit 1); exit 1 502 | } 503 | } && 504 | 505 | # Now rename the file to the real destination. 506 | $doit $mvcmd "$dsttmp" "$dst" 507 | } 508 | fi || exit 1 509 | 510 | trap '' 0 511 | fi 512 | done 513 | 514 | # Local variables: 515 | # eval: (add-hook 'write-file-hooks 'time-stamp) 516 | # time-stamp-start: "scriptversion=" 517 | # time-stamp-format: "%:y-%02m-%02d.%02H" 518 | # time-stamp-time-zone: "UTC" 519 | # time-stamp-end: "; # UTC" 520 | # End: 521 | -------------------------------------------------------------------------------- /missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 7 | # 2008, 2009 Free Software Foundation, Inc. 8 | # Originally by Fran,cois Pinard , 1996. 9 | 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, see . 22 | 23 | # As a special exception to the GNU General Public License, if you 24 | # distribute this file as part of a program that contains a 25 | # configuration script generated by Autoconf, you may include it under 26 | # the same distribution terms that you use for the rest of that program. 27 | 28 | if test $# -eq 0; then 29 | echo 1>&2 "Try \`$0 --help' for more information" 30 | exit 1 31 | fi 32 | 33 | run=: 34 | sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' 35 | sed_minuso='s/.* -o \([^ ]*\).*/\1/p' 36 | 37 | # In the cases where this matters, `missing' is being run in the 38 | # srcdir already. 39 | if test -f configure.ac; then 40 | configure_ac=configure.ac 41 | else 42 | configure_ac=configure.in 43 | fi 44 | 45 | msg="missing on your system" 46 | 47 | case $1 in 48 | --run) 49 | # Try to run requested program, and just exit if it succeeds. 50 | run= 51 | shift 52 | "$@" && exit 0 53 | # Exit code 63 means version mismatch. This often happens 54 | # when the user try to use an ancient version of a tool on 55 | # a file that requires a minimum version. In this case we 56 | # we should proceed has if the program had been absent, or 57 | # if --run hadn't been passed. 58 | if test $? = 63; then 59 | run=: 60 | msg="probably too old" 61 | fi 62 | ;; 63 | 64 | -h|--h|--he|--hel|--help) 65 | echo "\ 66 | $0 [OPTION]... PROGRAM [ARGUMENT]... 67 | 68 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 69 | error status if there is no known handling for PROGRAM. 70 | 71 | Options: 72 | -h, --help display this help and exit 73 | -v, --version output version information and exit 74 | --run try to run the given command, and emulate it if it fails 75 | 76 | Supported PROGRAM values: 77 | aclocal touch file \`aclocal.m4' 78 | autoconf touch file \`configure' 79 | autoheader touch file \`config.h.in' 80 | autom4te touch the output file, or create a stub one 81 | automake touch all \`Makefile.in' files 82 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 83 | flex create \`lex.yy.c', if possible, from existing .c 84 | help2man touch the output file 85 | lex create \`lex.yy.c', if possible, from existing .c 86 | makeinfo touch the output file 87 | tar try tar, gnutar, gtar, then tar without non-portable flags 88 | yacc create \`y.tab.[ch]', if possible, from existing .[ch] 89 | 90 | Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and 91 | \`g' are ignored when checking the name. 92 | 93 | Send bug reports to ." 94 | exit $? 95 | ;; 96 | 97 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 98 | echo "missing $scriptversion (GNU Automake)" 99 | exit $? 100 | ;; 101 | 102 | -*) 103 | echo 1>&2 "$0: Unknown \`$1' option" 104 | echo 1>&2 "Try \`$0 --help' for more information" 105 | exit 1 106 | ;; 107 | 108 | esac 109 | 110 | # normalize program name to check for. 111 | program=`echo "$1" | sed ' 112 | s/^gnu-//; t 113 | s/^gnu//; t 114 | s/^g//; t'` 115 | 116 | # Now exit if we have it, but it failed. Also exit now if we 117 | # don't have it and --version was passed (most likely to detect 118 | # the program). This is about non-GNU programs, so use $1 not 119 | # $program. 120 | case $1 in 121 | lex*|yacc*) 122 | # Not GNU programs, they don't have --version. 123 | ;; 124 | 125 | tar*) 126 | if test -n "$run"; then 127 | echo 1>&2 "ERROR: \`tar' requires --run" 128 | exit 1 129 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 130 | exit 1 131 | fi 132 | ;; 133 | 134 | *) 135 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 136 | # We have it, but it failed. 137 | exit 1 138 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 139 | # Could not run --version or --help. This is probably someone 140 | # running `$TOOL --version' or `$TOOL --help' to check whether 141 | # $TOOL exists and not knowing $TOOL uses missing. 142 | exit 1 143 | fi 144 | ;; 145 | esac 146 | 147 | # If it does not exist, or fails to run (possibly an outdated version), 148 | # try to emulate it. 149 | case $program in 150 | aclocal*) 151 | echo 1>&2 "\ 152 | WARNING: \`$1' is $msg. You should only need it if 153 | you modified \`acinclude.m4' or \`${configure_ac}'. You might want 154 | to install the \`Automake' and \`Perl' packages. Grab them from 155 | any GNU archive site." 156 | touch aclocal.m4 157 | ;; 158 | 159 | autoconf*) 160 | echo 1>&2 "\ 161 | WARNING: \`$1' is $msg. You should only need it if 162 | you modified \`${configure_ac}'. You might want to install the 163 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 164 | archive site." 165 | touch configure 166 | ;; 167 | 168 | autoheader*) 169 | echo 1>&2 "\ 170 | WARNING: \`$1' is $msg. You should only need it if 171 | you modified \`acconfig.h' or \`${configure_ac}'. You might want 172 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 173 | from any GNU archive site." 174 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 175 | test -z "$files" && files="config.h" 176 | touch_files= 177 | for f in $files; do 178 | case $f in 179 | *:*) touch_files="$touch_files "`echo "$f" | 180 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 181 | *) touch_files="$touch_files $f.in";; 182 | esac 183 | done 184 | touch $touch_files 185 | ;; 186 | 187 | automake*) 188 | echo 1>&2 "\ 189 | WARNING: \`$1' is $msg. You should only need it if 190 | you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 191 | You might want to install the \`Automake' and \`Perl' packages. 192 | Grab them from any GNU archive site." 193 | find . -type f -name Makefile.am -print | 194 | sed 's/\.am$/.in/' | 195 | while read f; do touch "$f"; done 196 | ;; 197 | 198 | autom4te*) 199 | echo 1>&2 "\ 200 | WARNING: \`$1' is needed, but is $msg. 201 | You might have modified some files without having the 202 | proper tools for further handling them. 203 | You can get \`$1' as part of \`Autoconf' from any GNU 204 | archive site." 205 | 206 | file=`echo "$*" | sed -n "$sed_output"` 207 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 208 | if test -f "$file"; then 209 | touch $file 210 | else 211 | test -z "$file" || exec >$file 212 | echo "#! /bin/sh" 213 | echo "# Created by GNU Automake missing as a replacement of" 214 | echo "# $ $@" 215 | echo "exit 0" 216 | chmod +x $file 217 | exit 1 218 | fi 219 | ;; 220 | 221 | bison*|yacc*) 222 | echo 1>&2 "\ 223 | WARNING: \`$1' $msg. You should only need it if 224 | you modified a \`.y' file. You may need the \`Bison' package 225 | in order for those modifications to take effect. You can get 226 | \`Bison' from any GNU archive site." 227 | rm -f y.tab.c y.tab.h 228 | if test $# -ne 1; then 229 | eval LASTARG="\${$#}" 230 | case $LASTARG in 231 | *.y) 232 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 233 | if test -f "$SRCFILE"; then 234 | cp "$SRCFILE" y.tab.c 235 | fi 236 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 237 | if test -f "$SRCFILE"; then 238 | cp "$SRCFILE" y.tab.h 239 | fi 240 | ;; 241 | esac 242 | fi 243 | if test ! -f y.tab.h; then 244 | echo >y.tab.h 245 | fi 246 | if test ! -f y.tab.c; then 247 | echo 'main() { return 0; }' >y.tab.c 248 | fi 249 | ;; 250 | 251 | lex*|flex*) 252 | echo 1>&2 "\ 253 | WARNING: \`$1' is $msg. You should only need it if 254 | you modified a \`.l' file. You may need the \`Flex' package 255 | in order for those modifications to take effect. You can get 256 | \`Flex' from any GNU archive site." 257 | rm -f lex.yy.c 258 | if test $# -ne 1; then 259 | eval LASTARG="\${$#}" 260 | case $LASTARG in 261 | *.l) 262 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 263 | if test -f "$SRCFILE"; then 264 | cp "$SRCFILE" lex.yy.c 265 | fi 266 | ;; 267 | esac 268 | fi 269 | if test ! -f lex.yy.c; then 270 | echo 'main() { return 0; }' >lex.yy.c 271 | fi 272 | ;; 273 | 274 | help2man*) 275 | echo 1>&2 "\ 276 | WARNING: \`$1' is $msg. You should only need it if 277 | you modified a dependency of a manual page. You may need the 278 | \`Help2man' package in order for those modifications to take 279 | effect. You can get \`Help2man' from any GNU archive site." 280 | 281 | file=`echo "$*" | sed -n "$sed_output"` 282 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 283 | if test -f "$file"; then 284 | touch $file 285 | else 286 | test -z "$file" || exec >$file 287 | echo ".ab help2man is required to generate this page" 288 | exit $? 289 | fi 290 | ;; 291 | 292 | makeinfo*) 293 | echo 1>&2 "\ 294 | WARNING: \`$1' is $msg. You should only need it if 295 | you modified a \`.texi' or \`.texinfo' file, or any other file 296 | indirectly affecting the aspect of the manual. The spurious 297 | call might also be the consequence of using a buggy \`make' (AIX, 298 | DU, IRIX). You might want to install the \`Texinfo' package or 299 | the \`GNU make' package. Grab either from any GNU archive site." 300 | # The file to touch is that specified with -o ... 301 | file=`echo "$*" | sed -n "$sed_output"` 302 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 303 | if test -z "$file"; then 304 | # ... or it is the one specified with @setfilename ... 305 | infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 306 | file=`sed -n ' 307 | /^@setfilename/{ 308 | s/.* \([^ ]*\) *$/\1/ 309 | p 310 | q 311 | }' $infile` 312 | # ... or it is derived from the source name (dir/f.texi becomes f.info) 313 | test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 314 | fi 315 | # If the file does not exist, the user really needs makeinfo; 316 | # let's fail without touching anything. 317 | test -f $file || exit 1 318 | touch $file 319 | ;; 320 | 321 | tar*) 322 | shift 323 | 324 | # We have already tried tar in the generic part. 325 | # Look for gnutar/gtar before invocation to avoid ugly error 326 | # messages. 327 | if (gnutar --version > /dev/null 2>&1); then 328 | gnutar "$@" && exit 0 329 | fi 330 | if (gtar --version > /dev/null 2>&1); then 331 | gtar "$@" && exit 0 332 | fi 333 | firstarg="$1" 334 | if shift; then 335 | case $firstarg in 336 | *o*) 337 | firstarg=`echo "$firstarg" | sed s/o//` 338 | tar "$firstarg" "$@" && exit 0 339 | ;; 340 | esac 341 | case $firstarg in 342 | *h*) 343 | firstarg=`echo "$firstarg" | sed s/h//` 344 | tar "$firstarg" "$@" && exit 0 345 | ;; 346 | esac 347 | fi 348 | 349 | echo 1>&2 "\ 350 | WARNING: I can't seem to be able to run \`tar' with the given arguments. 351 | You may want to install GNU tar or Free paxutils, or check the 352 | command line arguments." 353 | exit 1 354 | ;; 355 | 356 | *) 357 | echo 1>&2 "\ 358 | WARNING: \`$1' is needed, and is $msg. 359 | You might have modified some files without having the 360 | proper tools for further handling them. Check the \`README' file, 361 | it often tells you about the needed prerequisites for installing 362 | this package. You may also peek at any GNU archive site, in case 363 | some other package would contain this missing \`$1' program." 364 | exit 1 365 | ;; 366 | esac 367 | 368 | exit 0 369 | 370 | # Local variables: 371 | # eval: (add-hook 'write-file-hooks 'time-stamp) 372 | # time-stamp-start: "scriptversion=" 373 | # time-stamp-format: "%:y-%02m-%02d.%02H" 374 | # time-stamp-time-zone: "UTC" 375 | # time-stamp-end: "; # UTC" 376 | # End: 377 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS = bxtools 2 | 3 | bxtools_CPPFLAGS = \ 4 | -I$(top_srcdir)/SeqLib \ 5 | -I$(top_srcdir)/SeqLib/htslib -Wno-sign-compare 6 | 7 | bxtools_LDADD = \ 8 | $(top_builddir)/SeqLib/src/libseqlib.a \ 9 | $(top_builddir)/SeqLib/htslib/libhts.a 10 | 11 | bxtools_SOURCES = bxtools.cpp bxsplit.cpp bxstats.cpp bxtile.cpp bxrelabel.cpp bxconvert.cpp bxmol.cpp bxgroup.cpp 12 | 13 | -------------------------------------------------------------------------------- /src/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.15 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994-2014 Free Software Foundation, Inc. 5 | 6 | # This Makefile.in is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | @SET_MAKE@ 16 | 17 | VPATH = @srcdir@ 18 | am__is_gnu_make = { \ 19 | if test -z '$(MAKELEVEL)'; then \ 20 | false; \ 21 | elif test -n '$(MAKE_HOST)'; then \ 22 | true; \ 23 | elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ 24 | true; \ 25 | else \ 26 | false; \ 27 | fi; \ 28 | } 29 | am__make_running_with_option = \ 30 | case $${target_option-} in \ 31 | ?) ;; \ 32 | *) echo "am__make_running_with_option: internal error: invalid" \ 33 | "target option '$${target_option-}' specified" >&2; \ 34 | exit 1;; \ 35 | esac; \ 36 | has_opt=no; \ 37 | sane_makeflags=$$MAKEFLAGS; \ 38 | if $(am__is_gnu_make); then \ 39 | sane_makeflags=$$MFLAGS; \ 40 | else \ 41 | case $$MAKEFLAGS in \ 42 | *\\[\ \ ]*) \ 43 | bs=\\; \ 44 | sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ 45 | | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ 46 | esac; \ 47 | fi; \ 48 | skip_next=no; \ 49 | strip_trailopt () \ 50 | { \ 51 | flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ 52 | }; \ 53 | for flg in $$sane_makeflags; do \ 54 | test $$skip_next = yes && { skip_next=no; continue; }; \ 55 | case $$flg in \ 56 | *=*|--*) continue;; \ 57 | -*I) strip_trailopt 'I'; skip_next=yes;; \ 58 | -*I?*) strip_trailopt 'I';; \ 59 | -*O) strip_trailopt 'O'; skip_next=yes;; \ 60 | -*O?*) strip_trailopt 'O';; \ 61 | -*l) strip_trailopt 'l'; skip_next=yes;; \ 62 | -*l?*) strip_trailopt 'l';; \ 63 | -[dEDm]) skip_next=yes;; \ 64 | -[JT]) skip_next=yes;; \ 65 | esac; \ 66 | case $$flg in \ 67 | *$$target_option*) has_opt=yes; break;; \ 68 | esac; \ 69 | done; \ 70 | test $$has_opt = yes 71 | am__make_dryrun = (target_option=n; $(am__make_running_with_option)) 72 | am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 73 | pkgdatadir = $(datadir)/@PACKAGE@ 74 | pkgincludedir = $(includedir)/@PACKAGE@ 75 | pkglibdir = $(libdir)/@PACKAGE@ 76 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 77 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 78 | install_sh_DATA = $(install_sh) -c -m 644 79 | install_sh_PROGRAM = $(install_sh) -c 80 | install_sh_SCRIPT = $(install_sh) -c 81 | INSTALL_HEADER = $(INSTALL_DATA) 82 | transform = $(program_transform_name) 83 | NORMAL_INSTALL = : 84 | PRE_INSTALL = : 85 | POST_INSTALL = : 86 | NORMAL_UNINSTALL = : 87 | PRE_UNINSTALL = : 88 | POST_UNINSTALL = : 89 | bin_PROGRAMS = bxtools$(EXEEXT) 90 | subdir = src 91 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 92 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 93 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 94 | $(ACLOCAL_M4) 95 | DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) 96 | mkinstalldirs = $(install_sh) -d 97 | CONFIG_HEADER = $(top_builddir)/config.h 98 | CONFIG_CLEAN_FILES = 99 | CONFIG_CLEAN_VPATH_FILES = 100 | am__installdirs = "$(DESTDIR)$(bindir)" 101 | PROGRAMS = $(bin_PROGRAMS) 102 | am_bxtools_OBJECTS = bxtools-bxtools.$(OBJEXT) \ 103 | bxtools-bxsplit.$(OBJEXT) bxtools-bxstats.$(OBJEXT) \ 104 | bxtools-bxtile.$(OBJEXT) bxtools-bxrelabel.$(OBJEXT) \ 105 | bxtools-bxconvert.$(OBJEXT) bxtools-bxmol.$(OBJEXT) \ 106 | bxtools-bxgroup.$(OBJEXT) 107 | bxtools_OBJECTS = $(am_bxtools_OBJECTS) 108 | bxtools_DEPENDENCIES = $(top_builddir)/SeqLib/src/libseqlib.a \ 109 | $(top_builddir)/SeqLib/htslib/libhts.a 110 | AM_V_P = $(am__v_P_@AM_V@) 111 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) 112 | am__v_P_0 = false 113 | am__v_P_1 = : 114 | AM_V_GEN = $(am__v_GEN_@AM_V@) 115 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) 116 | am__v_GEN_0 = @echo " GEN " $@; 117 | am__v_GEN_1 = 118 | AM_V_at = $(am__v_at_@AM_V@) 119 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) 120 | am__v_at_0 = @ 121 | am__v_at_1 = 122 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) 123 | depcomp = $(SHELL) $(top_srcdir)/depcomp 124 | am__depfiles_maybe = depfiles 125 | am__mv = mv -f 126 | AM_V_lt = $(am__v_lt_@AM_V@) 127 | am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) 128 | am__v_lt_0 = --silent 129 | am__v_lt_1 = 130 | CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 131 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) 132 | AM_V_CXX = $(am__v_CXX_@AM_V@) 133 | am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) 134 | am__v_CXX_0 = @echo " CXX " $@; 135 | am__v_CXX_1 = 136 | CXXLD = $(CXX) 137 | CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ 138 | -o $@ 139 | AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) 140 | am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) 141 | am__v_CXXLD_0 = @echo " CXXLD " $@; 142 | am__v_CXXLD_1 = 143 | SOURCES = $(bxtools_SOURCES) 144 | DIST_SOURCES = $(bxtools_SOURCES) 145 | am__can_run_installinfo = \ 146 | case $$AM_UPDATE_INFO_DIR in \ 147 | n|no|NO) false;; \ 148 | *) (install-info --version) >/dev/null 2>&1;; \ 149 | esac 150 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 151 | # Read a list of newline-separated strings from the standard input, 152 | # and print each of them once, without duplicates. Input order is 153 | # *not* preserved. 154 | am__uniquify_input = $(AWK) '\ 155 | BEGIN { nonempty = 0; } \ 156 | { items[$$0] = 1; nonempty = 1; } \ 157 | END { if (nonempty) { for (i in items) print i; }; } \ 158 | ' 159 | # Make sure the list of sources is unique. This is necessary because, 160 | # e.g., the same source file might be shared among _SOURCES variables 161 | # for different programs/libraries. 162 | am__define_uniq_tagged_files = \ 163 | list='$(am__tagged_files)'; \ 164 | unique=`for i in $$list; do \ 165 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 166 | done | $(am__uniquify_input)` 167 | ETAGS = etags 168 | CTAGS = ctags 169 | am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp 170 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 171 | ACLOCAL = @ACLOCAL@ 172 | AMTAR = @AMTAR@ 173 | AM_CXXFLAGS = @AM_CXXFLAGS@ 174 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 175 | AUTOCONF = @AUTOCONF@ 176 | AUTOHEADER = @AUTOHEADER@ 177 | AUTOMAKE = @AUTOMAKE@ 178 | AWK = @AWK@ 179 | CC = @CC@ 180 | CCDEPMODE = @CCDEPMODE@ 181 | CFLAGS = @CFLAGS@ 182 | CPPFLAGS = @CPPFLAGS@ 183 | CXX = @CXX@ 184 | CXXCPP = @CXXCPP@ 185 | CXXDEPMODE = @CXXDEPMODE@ 186 | CXXFLAGS = @CXXFLAGS@ 187 | CYGPATH_W = @CYGPATH_W@ 188 | DEFS = @DEFS@ 189 | DEPDIR = @DEPDIR@ 190 | ECHO_C = @ECHO_C@ 191 | ECHO_N = @ECHO_N@ 192 | ECHO_T = @ECHO_T@ 193 | EGREP = @EGREP@ 194 | EXEEXT = @EXEEXT@ 195 | GREP = @GREP@ 196 | INSTALL = @INSTALL@ 197 | INSTALL_DATA = @INSTALL_DATA@ 198 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 199 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 200 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 201 | LDFLAGS = @LDFLAGS@ 202 | LIBOBJS = @LIBOBJS@ 203 | LIBS = @LIBS@ 204 | LTLIBOBJS = @LTLIBOBJS@ 205 | MAINT = @MAINT@ 206 | MAKEINFO = @MAKEINFO@ 207 | MKDIR_P = @MKDIR_P@ 208 | OBJEXT = @OBJEXT@ 209 | PACKAGE = @PACKAGE@ 210 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 211 | PACKAGE_NAME = @PACKAGE_NAME@ 212 | PACKAGE_STRING = @PACKAGE_STRING@ 213 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 214 | PACKAGE_URL = @PACKAGE_URL@ 215 | PACKAGE_VERSION = @PACKAGE_VERSION@ 216 | PATH_SEPARATOR = @PATH_SEPARATOR@ 217 | RANLIB = @RANLIB@ 218 | SET_MAKE = @SET_MAKE@ 219 | SHELL = @SHELL@ 220 | STRIP = @STRIP@ 221 | VERSION = @VERSION@ 222 | abs_builddir = @abs_builddir@ 223 | abs_srcdir = @abs_srcdir@ 224 | abs_top_builddir = @abs_top_builddir@ 225 | abs_top_srcdir = @abs_top_srcdir@ 226 | ac_ct_CC = @ac_ct_CC@ 227 | ac_ct_CXX = @ac_ct_CXX@ 228 | am__include = @am__include@ 229 | am__leading_dot = @am__leading_dot@ 230 | am__quote = @am__quote@ 231 | am__tar = @am__tar@ 232 | am__untar = @am__untar@ 233 | bindir = @bindir@ 234 | build_alias = @build_alias@ 235 | builddir = @builddir@ 236 | datadir = @datadir@ 237 | datarootdir = @datarootdir@ 238 | docdir = @docdir@ 239 | dvidir = @dvidir@ 240 | exec_prefix = @exec_prefix@ 241 | host_alias = @host_alias@ 242 | htmldir = @htmldir@ 243 | includedir = @includedir@ 244 | infodir = @infodir@ 245 | install_sh = @install_sh@ 246 | libdir = @libdir@ 247 | libexecdir = @libexecdir@ 248 | localedir = @localedir@ 249 | localstatedir = @localstatedir@ 250 | mandir = @mandir@ 251 | mkdir_p = @mkdir_p@ 252 | oldincludedir = @oldincludedir@ 253 | pdfdir = @pdfdir@ 254 | prefix = @prefix@ 255 | program_transform_name = @program_transform_name@ 256 | psdir = @psdir@ 257 | sbindir = @sbindir@ 258 | sharedstatedir = @sharedstatedir@ 259 | srcdir = @srcdir@ 260 | sysconfdir = @sysconfdir@ 261 | target_alias = @target_alias@ 262 | top_build_prefix = @top_build_prefix@ 263 | top_builddir = @top_builddir@ 264 | top_srcdir = @top_srcdir@ 265 | bxtools_CPPFLAGS = \ 266 | -I$(top_srcdir)/SeqLib \ 267 | -I$(top_srcdir)/SeqLib/htslib -Wno-sign-compare 268 | 269 | bxtools_LDADD = \ 270 | $(top_builddir)/SeqLib/src/libseqlib.a \ 271 | $(top_builddir)/SeqLib/htslib/libhts.a 272 | 273 | bxtools_SOURCES = bxtools.cpp bxsplit.cpp bxstats.cpp bxtile.cpp bxrelabel.cpp bxconvert.cpp bxmol.cpp bxgroup.cpp 274 | all: all-am 275 | 276 | .SUFFIXES: 277 | .SUFFIXES: .cpp .o .obj 278 | $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) 279 | @for dep in $?; do \ 280 | case '$(am__configure_deps)' in \ 281 | *$$dep*) \ 282 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 283 | && { if test -f $@; then exit 0; else break; fi; }; \ 284 | exit 1;; \ 285 | esac; \ 286 | done; \ 287 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ 288 | $(am__cd) $(top_srcdir) && \ 289 | $(AUTOMAKE) --foreign src/Makefile 290 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 291 | @case '$?' in \ 292 | *config.status*) \ 293 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 294 | *) \ 295 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 296 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 297 | esac; 298 | 299 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 300 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 301 | 302 | $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 303 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 304 | $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) 305 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 306 | $(am__aclocal_m4_deps): 307 | install-binPROGRAMS: $(bin_PROGRAMS) 308 | @$(NORMAL_INSTALL) 309 | @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 310 | if test -n "$$list"; then \ 311 | echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ 312 | $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ 313 | fi; \ 314 | for p in $$list; do echo "$$p $$p"; done | \ 315 | sed 's/$(EXEEXT)$$//' | \ 316 | while read p p1; do if test -f $$p \ 317 | ; then echo "$$p"; echo "$$p"; else :; fi; \ 318 | done | \ 319 | sed -e 'p;s,.*/,,;n;h' \ 320 | -e 's|.*|.|' \ 321 | -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 322 | sed 'N;N;N;s,\n, ,g' | \ 323 | $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ 324 | { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ 325 | if ($$2 == $$4) files[d] = files[d] " " $$1; \ 326 | else { print "f", $$3 "/" $$4, $$1; } } \ 327 | END { for (d in files) print "f", d, files[d] }' | \ 328 | while read type dir files; do \ 329 | if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ 330 | test -z "$$files" || { \ 331 | echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ 332 | $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ 333 | } \ 334 | ; done 335 | 336 | uninstall-binPROGRAMS: 337 | @$(NORMAL_UNINSTALL) 338 | @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 339 | files=`for p in $$list; do echo "$$p"; done | \ 340 | sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ 341 | -e 's/$$/$(EXEEXT)/' \ 342 | `; \ 343 | test -n "$$list" || exit 0; \ 344 | echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ 345 | cd "$(DESTDIR)$(bindir)" && rm -f $$files 346 | 347 | clean-binPROGRAMS: 348 | -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) 349 | 350 | bxtools$(EXEEXT): $(bxtools_OBJECTS) $(bxtools_DEPENDENCIES) $(EXTRA_bxtools_DEPENDENCIES) 351 | @rm -f bxtools$(EXEEXT) 352 | $(AM_V_CXXLD)$(CXXLINK) $(bxtools_OBJECTS) $(bxtools_LDADD) $(LIBS) 353 | 354 | mostlyclean-compile: 355 | -rm -f *.$(OBJEXT) 356 | 357 | distclean-compile: 358 | -rm -f *.tab.c 359 | 360 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bxtools-bxconvert.Po@am__quote@ 361 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bxtools-bxgroup.Po@am__quote@ 362 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bxtools-bxmol.Po@am__quote@ 363 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bxtools-bxrelabel.Po@am__quote@ 364 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bxtools-bxsplit.Po@am__quote@ 365 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bxtools-bxstats.Po@am__quote@ 366 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bxtools-bxtile.Po@am__quote@ 367 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bxtools-bxtools.Po@am__quote@ 368 | 369 | .cpp.o: 370 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 371 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 372 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 373 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 374 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< 375 | 376 | .cpp.obj: 377 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` 378 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 379 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 380 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 381 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` 382 | 383 | bxtools-bxtools.o: bxtools.cpp 384 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxtools.o -MD -MP -MF $(DEPDIR)/bxtools-bxtools.Tpo -c -o bxtools-bxtools.o `test -f 'bxtools.cpp' || echo '$(srcdir)/'`bxtools.cpp 385 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxtools.Tpo $(DEPDIR)/bxtools-bxtools.Po 386 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxtools.cpp' object='bxtools-bxtools.o' libtool=no @AMDEPBACKSLASH@ 387 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 388 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxtools.o `test -f 'bxtools.cpp' || echo '$(srcdir)/'`bxtools.cpp 389 | 390 | bxtools-bxtools.obj: bxtools.cpp 391 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxtools.obj -MD -MP -MF $(DEPDIR)/bxtools-bxtools.Tpo -c -o bxtools-bxtools.obj `if test -f 'bxtools.cpp'; then $(CYGPATH_W) 'bxtools.cpp'; else $(CYGPATH_W) '$(srcdir)/bxtools.cpp'; fi` 392 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxtools.Tpo $(DEPDIR)/bxtools-bxtools.Po 393 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxtools.cpp' object='bxtools-bxtools.obj' libtool=no @AMDEPBACKSLASH@ 394 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 395 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxtools.obj `if test -f 'bxtools.cpp'; then $(CYGPATH_W) 'bxtools.cpp'; else $(CYGPATH_W) '$(srcdir)/bxtools.cpp'; fi` 396 | 397 | bxtools-bxsplit.o: bxsplit.cpp 398 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxsplit.o -MD -MP -MF $(DEPDIR)/bxtools-bxsplit.Tpo -c -o bxtools-bxsplit.o `test -f 'bxsplit.cpp' || echo '$(srcdir)/'`bxsplit.cpp 399 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxsplit.Tpo $(DEPDIR)/bxtools-bxsplit.Po 400 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxsplit.cpp' object='bxtools-bxsplit.o' libtool=no @AMDEPBACKSLASH@ 401 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 402 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxsplit.o `test -f 'bxsplit.cpp' || echo '$(srcdir)/'`bxsplit.cpp 403 | 404 | bxtools-bxsplit.obj: bxsplit.cpp 405 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxsplit.obj -MD -MP -MF $(DEPDIR)/bxtools-bxsplit.Tpo -c -o bxtools-bxsplit.obj `if test -f 'bxsplit.cpp'; then $(CYGPATH_W) 'bxsplit.cpp'; else $(CYGPATH_W) '$(srcdir)/bxsplit.cpp'; fi` 406 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxsplit.Tpo $(DEPDIR)/bxtools-bxsplit.Po 407 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxsplit.cpp' object='bxtools-bxsplit.obj' libtool=no @AMDEPBACKSLASH@ 408 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 409 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxsplit.obj `if test -f 'bxsplit.cpp'; then $(CYGPATH_W) 'bxsplit.cpp'; else $(CYGPATH_W) '$(srcdir)/bxsplit.cpp'; fi` 410 | 411 | bxtools-bxstats.o: bxstats.cpp 412 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxstats.o -MD -MP -MF $(DEPDIR)/bxtools-bxstats.Tpo -c -o bxtools-bxstats.o `test -f 'bxstats.cpp' || echo '$(srcdir)/'`bxstats.cpp 413 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxstats.Tpo $(DEPDIR)/bxtools-bxstats.Po 414 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxstats.cpp' object='bxtools-bxstats.o' libtool=no @AMDEPBACKSLASH@ 415 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 416 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxstats.o `test -f 'bxstats.cpp' || echo '$(srcdir)/'`bxstats.cpp 417 | 418 | bxtools-bxstats.obj: bxstats.cpp 419 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxstats.obj -MD -MP -MF $(DEPDIR)/bxtools-bxstats.Tpo -c -o bxtools-bxstats.obj `if test -f 'bxstats.cpp'; then $(CYGPATH_W) 'bxstats.cpp'; else $(CYGPATH_W) '$(srcdir)/bxstats.cpp'; fi` 420 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxstats.Tpo $(DEPDIR)/bxtools-bxstats.Po 421 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxstats.cpp' object='bxtools-bxstats.obj' libtool=no @AMDEPBACKSLASH@ 422 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 423 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxstats.obj `if test -f 'bxstats.cpp'; then $(CYGPATH_W) 'bxstats.cpp'; else $(CYGPATH_W) '$(srcdir)/bxstats.cpp'; fi` 424 | 425 | bxtools-bxtile.o: bxtile.cpp 426 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxtile.o -MD -MP -MF $(DEPDIR)/bxtools-bxtile.Tpo -c -o bxtools-bxtile.o `test -f 'bxtile.cpp' || echo '$(srcdir)/'`bxtile.cpp 427 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxtile.Tpo $(DEPDIR)/bxtools-bxtile.Po 428 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxtile.cpp' object='bxtools-bxtile.o' libtool=no @AMDEPBACKSLASH@ 429 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 430 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxtile.o `test -f 'bxtile.cpp' || echo '$(srcdir)/'`bxtile.cpp 431 | 432 | bxtools-bxtile.obj: bxtile.cpp 433 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxtile.obj -MD -MP -MF $(DEPDIR)/bxtools-bxtile.Tpo -c -o bxtools-bxtile.obj `if test -f 'bxtile.cpp'; then $(CYGPATH_W) 'bxtile.cpp'; else $(CYGPATH_W) '$(srcdir)/bxtile.cpp'; fi` 434 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxtile.Tpo $(DEPDIR)/bxtools-bxtile.Po 435 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxtile.cpp' object='bxtools-bxtile.obj' libtool=no @AMDEPBACKSLASH@ 436 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 437 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxtile.obj `if test -f 'bxtile.cpp'; then $(CYGPATH_W) 'bxtile.cpp'; else $(CYGPATH_W) '$(srcdir)/bxtile.cpp'; fi` 438 | 439 | bxtools-bxrelabel.o: bxrelabel.cpp 440 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxrelabel.o -MD -MP -MF $(DEPDIR)/bxtools-bxrelabel.Tpo -c -o bxtools-bxrelabel.o `test -f 'bxrelabel.cpp' || echo '$(srcdir)/'`bxrelabel.cpp 441 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxrelabel.Tpo $(DEPDIR)/bxtools-bxrelabel.Po 442 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxrelabel.cpp' object='bxtools-bxrelabel.o' libtool=no @AMDEPBACKSLASH@ 443 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 444 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxrelabel.o `test -f 'bxrelabel.cpp' || echo '$(srcdir)/'`bxrelabel.cpp 445 | 446 | bxtools-bxrelabel.obj: bxrelabel.cpp 447 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxrelabel.obj -MD -MP -MF $(DEPDIR)/bxtools-bxrelabel.Tpo -c -o bxtools-bxrelabel.obj `if test -f 'bxrelabel.cpp'; then $(CYGPATH_W) 'bxrelabel.cpp'; else $(CYGPATH_W) '$(srcdir)/bxrelabel.cpp'; fi` 448 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxrelabel.Tpo $(DEPDIR)/bxtools-bxrelabel.Po 449 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxrelabel.cpp' object='bxtools-bxrelabel.obj' libtool=no @AMDEPBACKSLASH@ 450 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 451 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxrelabel.obj `if test -f 'bxrelabel.cpp'; then $(CYGPATH_W) 'bxrelabel.cpp'; else $(CYGPATH_W) '$(srcdir)/bxrelabel.cpp'; fi` 452 | 453 | bxtools-bxconvert.o: bxconvert.cpp 454 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxconvert.o -MD -MP -MF $(DEPDIR)/bxtools-bxconvert.Tpo -c -o bxtools-bxconvert.o `test -f 'bxconvert.cpp' || echo '$(srcdir)/'`bxconvert.cpp 455 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxconvert.Tpo $(DEPDIR)/bxtools-bxconvert.Po 456 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxconvert.cpp' object='bxtools-bxconvert.o' libtool=no @AMDEPBACKSLASH@ 457 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 458 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxconvert.o `test -f 'bxconvert.cpp' || echo '$(srcdir)/'`bxconvert.cpp 459 | 460 | bxtools-bxconvert.obj: bxconvert.cpp 461 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxconvert.obj -MD -MP -MF $(DEPDIR)/bxtools-bxconvert.Tpo -c -o bxtools-bxconvert.obj `if test -f 'bxconvert.cpp'; then $(CYGPATH_W) 'bxconvert.cpp'; else $(CYGPATH_W) '$(srcdir)/bxconvert.cpp'; fi` 462 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxconvert.Tpo $(DEPDIR)/bxtools-bxconvert.Po 463 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxconvert.cpp' object='bxtools-bxconvert.obj' libtool=no @AMDEPBACKSLASH@ 464 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 465 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxconvert.obj `if test -f 'bxconvert.cpp'; then $(CYGPATH_W) 'bxconvert.cpp'; else $(CYGPATH_W) '$(srcdir)/bxconvert.cpp'; fi` 466 | 467 | bxtools-bxmol.o: bxmol.cpp 468 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxmol.o -MD -MP -MF $(DEPDIR)/bxtools-bxmol.Tpo -c -o bxtools-bxmol.o `test -f 'bxmol.cpp' || echo '$(srcdir)/'`bxmol.cpp 469 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxmol.Tpo $(DEPDIR)/bxtools-bxmol.Po 470 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxmol.cpp' object='bxtools-bxmol.o' libtool=no @AMDEPBACKSLASH@ 471 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 472 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxmol.o `test -f 'bxmol.cpp' || echo '$(srcdir)/'`bxmol.cpp 473 | 474 | bxtools-bxmol.obj: bxmol.cpp 475 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxmol.obj -MD -MP -MF $(DEPDIR)/bxtools-bxmol.Tpo -c -o bxtools-bxmol.obj `if test -f 'bxmol.cpp'; then $(CYGPATH_W) 'bxmol.cpp'; else $(CYGPATH_W) '$(srcdir)/bxmol.cpp'; fi` 476 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxmol.Tpo $(DEPDIR)/bxtools-bxmol.Po 477 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxmol.cpp' object='bxtools-bxmol.obj' libtool=no @AMDEPBACKSLASH@ 478 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 479 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxmol.obj `if test -f 'bxmol.cpp'; then $(CYGPATH_W) 'bxmol.cpp'; else $(CYGPATH_W) '$(srcdir)/bxmol.cpp'; fi` 480 | 481 | bxtools-bxgroup.o: bxgroup.cpp 482 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxgroup.o -MD -MP -MF $(DEPDIR)/bxtools-bxgroup.Tpo -c -o bxtools-bxgroup.o `test -f 'bxgroup.cpp' || echo '$(srcdir)/'`bxgroup.cpp 483 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxgroup.Tpo $(DEPDIR)/bxtools-bxgroup.Po 484 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxgroup.cpp' object='bxtools-bxgroup.o' libtool=no @AMDEPBACKSLASH@ 485 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 486 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxgroup.o `test -f 'bxgroup.cpp' || echo '$(srcdir)/'`bxgroup.cpp 487 | 488 | bxtools-bxgroup.obj: bxgroup.cpp 489 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bxtools-bxgroup.obj -MD -MP -MF $(DEPDIR)/bxtools-bxgroup.Tpo -c -o bxtools-bxgroup.obj `if test -f 'bxgroup.cpp'; then $(CYGPATH_W) 'bxgroup.cpp'; else $(CYGPATH_W) '$(srcdir)/bxgroup.cpp'; fi` 490 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bxtools-bxgroup.Tpo $(DEPDIR)/bxtools-bxgroup.Po 491 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bxgroup.cpp' object='bxtools-bxgroup.obj' libtool=no @AMDEPBACKSLASH@ 492 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 493 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bxtools_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bxtools-bxgroup.obj `if test -f 'bxgroup.cpp'; then $(CYGPATH_W) 'bxgroup.cpp'; else $(CYGPATH_W) '$(srcdir)/bxgroup.cpp'; fi` 494 | 495 | ID: $(am__tagged_files) 496 | $(am__define_uniq_tagged_files); mkid -fID $$unique 497 | tags: tags-am 498 | TAGS: tags 499 | 500 | tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 501 | set x; \ 502 | here=`pwd`; \ 503 | $(am__define_uniq_tagged_files); \ 504 | shift; \ 505 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 506 | test -n "$$unique" || unique=$$empty_fix; \ 507 | if test $$# -gt 0; then \ 508 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 509 | "$$@" $$unique; \ 510 | else \ 511 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 512 | $$unique; \ 513 | fi; \ 514 | fi 515 | ctags: ctags-am 516 | 517 | CTAGS: ctags 518 | ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 519 | $(am__define_uniq_tagged_files); \ 520 | test -z "$(CTAGS_ARGS)$$unique" \ 521 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 522 | $$unique 523 | 524 | GTAGS: 525 | here=`$(am__cd) $(top_builddir) && pwd` \ 526 | && $(am__cd) $(top_srcdir) \ 527 | && gtags -i $(GTAGS_ARGS) "$$here" 528 | cscopelist: cscopelist-am 529 | 530 | cscopelist-am: $(am__tagged_files) 531 | list='$(am__tagged_files)'; \ 532 | case "$(srcdir)" in \ 533 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ 534 | *) sdir=$(subdir)/$(srcdir) ;; \ 535 | esac; \ 536 | for i in $$list; do \ 537 | if test -f "$$i"; then \ 538 | echo "$(subdir)/$$i"; \ 539 | else \ 540 | echo "$$sdir/$$i"; \ 541 | fi; \ 542 | done >> $(top_builddir)/cscope.files 543 | 544 | distclean-tags: 545 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 546 | 547 | distdir: $(DISTFILES) 548 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 549 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 550 | list='$(DISTFILES)'; \ 551 | dist_files=`for file in $$list; do echo $$file; done | \ 552 | sed -e "s|^$$srcdirstrip/||;t" \ 553 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 554 | case $$dist_files in \ 555 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 556 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 557 | sort -u` ;; \ 558 | esac; \ 559 | for file in $$dist_files; do \ 560 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 561 | if test -d $$d/$$file; then \ 562 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 563 | if test -d "$(distdir)/$$file"; then \ 564 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 565 | fi; \ 566 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 567 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 568 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 569 | fi; \ 570 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 571 | else \ 572 | test -f "$(distdir)/$$file" \ 573 | || cp -p $$d/$$file "$(distdir)/$$file" \ 574 | || exit 1; \ 575 | fi; \ 576 | done 577 | check-am: all-am 578 | check: check-am 579 | all-am: Makefile $(PROGRAMS) 580 | installdirs: 581 | for dir in "$(DESTDIR)$(bindir)"; do \ 582 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 583 | done 584 | install: install-am 585 | install-exec: install-exec-am 586 | install-data: install-data-am 587 | uninstall: uninstall-am 588 | 589 | install-am: all-am 590 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 591 | 592 | installcheck: installcheck-am 593 | install-strip: 594 | if test -z '$(STRIP)'; then \ 595 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 596 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 597 | install; \ 598 | else \ 599 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 600 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 601 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 602 | fi 603 | mostlyclean-generic: 604 | 605 | clean-generic: 606 | 607 | distclean-generic: 608 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 609 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 610 | 611 | maintainer-clean-generic: 612 | @echo "This command is intended for maintainers to use" 613 | @echo "it deletes files that may require special tools to rebuild." 614 | clean: clean-am 615 | 616 | clean-am: clean-binPROGRAMS clean-generic mostlyclean-am 617 | 618 | distclean: distclean-am 619 | -rm -rf ./$(DEPDIR) 620 | -rm -f Makefile 621 | distclean-am: clean-am distclean-compile distclean-generic \ 622 | distclean-tags 623 | 624 | dvi: dvi-am 625 | 626 | dvi-am: 627 | 628 | html: html-am 629 | 630 | html-am: 631 | 632 | info: info-am 633 | 634 | info-am: 635 | 636 | install-data-am: 637 | 638 | install-dvi: install-dvi-am 639 | 640 | install-dvi-am: 641 | 642 | install-exec-am: install-binPROGRAMS 643 | 644 | install-html: install-html-am 645 | 646 | install-html-am: 647 | 648 | install-info: install-info-am 649 | 650 | install-info-am: 651 | 652 | install-man: 653 | 654 | install-pdf: install-pdf-am 655 | 656 | install-pdf-am: 657 | 658 | install-ps: install-ps-am 659 | 660 | install-ps-am: 661 | 662 | installcheck-am: 663 | 664 | maintainer-clean: maintainer-clean-am 665 | -rm -rf ./$(DEPDIR) 666 | -rm -f Makefile 667 | maintainer-clean-am: distclean-am maintainer-clean-generic 668 | 669 | mostlyclean: mostlyclean-am 670 | 671 | mostlyclean-am: mostlyclean-compile mostlyclean-generic 672 | 673 | pdf: pdf-am 674 | 675 | pdf-am: 676 | 677 | ps: ps-am 678 | 679 | ps-am: 680 | 681 | uninstall-am: uninstall-binPROGRAMS 682 | 683 | .MAKE: install-am install-strip 684 | 685 | .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ 686 | clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ 687 | distclean distclean-compile distclean-generic distclean-tags \ 688 | distdir dvi dvi-am html html-am info info-am install \ 689 | install-am install-binPROGRAMS install-data install-data-am \ 690 | install-dvi install-dvi-am install-exec install-exec-am \ 691 | install-html install-html-am install-info install-info-am \ 692 | install-man install-pdf install-pdf-am install-ps \ 693 | install-ps-am install-strip installcheck installcheck-am \ 694 | installdirs maintainer-clean maintainer-clean-generic \ 695 | mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ 696 | ps ps-am tags tags-am uninstall uninstall-am \ 697 | uninstall-binPROGRAMS 698 | 699 | .PRECIOUS: Makefile 700 | 701 | 702 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 703 | # Otherwise a system limit (for SysV at least) may be exceeded. 704 | .NOEXPORT: 705 | -------------------------------------------------------------------------------- /src/bxcommon.h: -------------------------------------------------------------------------------- 1 | #ifndef BXTOOLS_BXCOMMON_H__ 2 | #define BXTOOLS_BXCOMMON_H__ 3 | 4 | #define BXOPEN(reader, bam) \ 5 | if (!reader.Open(bam)) { \ 6 | std::cerr << "Failed to open bam: " << bam << std::endl; \ 7 | exit(EXIT_FAILURE); \ 8 | } \ 9 | 10 | #define BXLOOPCHECK(r, found, tag) \ 11 | ++count; \ 12 | if (count == 100000 && !(found)) \ 13 | std::cerr << "****1e5 reads in and haven't hit " << tag << " tag yet****" << std::endl; \ 14 | if (count == 1000000 && !(found)) \ 15 | std::cerr << "****1e6 reads in and haven't hit " << tag << " tag yet****" << std::endl; \ 16 | if (count % 1000000 == 0 && opt::verbose) \ 17 | std::cerr << "...at read " << SeqLib::AddCommas(count) << " at pos " << r.Brief() << std::endl; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/bxconvert.cpp: -------------------------------------------------------------------------------- 1 | #include "bxconvert.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "SeqLib/BamReader.h" 10 | #include "SeqLib/BamWriter.h" 11 | #include "SeqLib/GenomicRegionCollection.h" 12 | 13 | #include "bxcommon.h" 14 | 15 | static const char *CONVERT_USAGE_MESSAGE = 16 | "Usage: bxtools convert > converted.bam\n" 17 | "Description: Convert a BAM to a BX sorted BAM by switching BX and chromosome\n" 18 | "\n" 19 | " General options\n" 20 | " -v, --verbose Set verbose output\n" 21 | " -k, --keep-tags Add chromosome tag (CR) and position (PS) tag, and keep other tags. Default: delete all tags\n" 22 | " -t, --tag Tag to flip for chromosome. Default: BX\n" 23 | "\n"; 24 | 25 | namespace opt { 26 | static bool verbose = false; 27 | static std::string bam; 28 | static bool keeptags = false; 29 | static std::string tag = "BX"; 30 | } 31 | 32 | static const char* shortopts = "hvkt:"; 33 | static const struct option longopts[] = { 34 | { "help", no_argument, NULL, 'h' }, 35 | { "verbose", no_argument, NULL, 'v' }, 36 | { "keep-tags", no_argument, NULL, 'k' }, 37 | { "tag", required_argument, NULL, 't' }, 38 | { NULL, 0, NULL, 0 } 39 | }; 40 | 41 | static void read_bx(std::string& bx, const SeqLib::BamRecord& r); 42 | static const std::string empty_tag = "Empty"; 43 | 44 | void runConvert(int argc, char** argv) { 45 | 46 | parseOptions(argc, argv); 47 | 48 | SeqLib::BamReader reader; 49 | BXOPEN(reader, opt::bam); 50 | SeqLib::BamHeader hdr = reader.Header(); 51 | 52 | SeqLib::BamRecord r; 53 | SeqLib::BamWriter w; 54 | size_t count = 0, unique_bx = 0; 55 | std::string bx; 56 | std::unordered_map bxtags; 57 | std::stringstream ss; 58 | 59 | if (opt::bam.compare("-") == 0){ 60 | std::cerr << "Cant accept standard input as file" << std::endl; 61 | exit(EXIT_FAILURE); 62 | } 63 | 64 | if (opt::verbose) 65 | std::cerr << "...starting first pass to tally unique " << opt::tag << " tags" << std::endl; 66 | 67 | // Loop through file once to grab all BX tags and store in string to generate header 68 | ss << "@HD" << "\t" << "VN:1.4" << " " << "GO:none\tSO:unsorted" << std::endl; 69 | while (reader.GetNextRecord(r)){ 70 | read_bx(bx, r); 71 | 72 | BXLOOPCHECK(r, unique_bx > 1, opt::tag) 73 | if (!bxtags.count(bx)) { 74 | bxtags.insert(std::pair(bx, unique_bx)); 75 | ++unique_bx; 76 | ss << "@SQ" << "\t" << "SN:" << bx << "\t" << "LN:1" << std::endl; 77 | } 78 | 79 | } 80 | //write new header based on string generated from BX tags 81 | SeqLib::BamHeader bxbamheader (ss.str()); 82 | 83 | if (opt::verbose) 84 | std::cerr << "Found " << unique_bx << " unique barcodes" << std::endl; 85 | 86 | w.Open("-"); 87 | w.SetHeader(bxbamheader); 88 | w.WriteHeader(); 89 | 90 | //Loop through the BAM file again 91 | reader.Close(); 92 | SeqLib::BamReader reader2; 93 | BXOPEN(reader2, opt::bam); 94 | 95 | if (opt::verbose) 96 | std::cerr << "...starting second pass to flip chr and BX" << std::endl; 97 | 98 | while (reader2.GetNextRecord(r)) { 99 | 100 | if (opt::keeptags) { 101 | r.AddZTag("CR", r.ChrID() >= 0 ? hdr.IDtoName(r.ChrID()) : "*"); 102 | r.AddIntTag("POS", r.Position()); 103 | } 104 | 105 | read_bx(bx, r); // read the BX tag. Set default if not present 106 | BXLOOPCHECK(r, true, opt::tag) // read and check we have a BX 107 | r.SetChrID(bxtags[bx]); 108 | r.SetChrIDMate(-1); 109 | r.SetPosition(0); 110 | if (!opt::keeptags) 111 | r.RemoveAllTags(); 112 | 113 | w.WriteRecord(r); 114 | } 115 | w.Close(); 116 | } 117 | 118 | 119 | void parseOptions(int argc, char** argv) { 120 | 121 | bool die = false; 122 | bool help = false; 123 | 124 | if (argc < 2) 125 | die = true; 126 | else 127 | opt::bam = std::string(argv[1]); 128 | 129 | std::stringstream ss; 130 | 131 | for (char c; (c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1;) \ 132 | { 133 | std::istringstream arg(optarg != NULL ? optarg : ""); 134 | switch (c) { 135 | case 'v': opt::verbose = true; break; 136 | case 'h': help = true; break; 137 | case 'k': opt::keeptags = true; break; 138 | case 't': arg >> opt::tag; break; 139 | } 140 | } 141 | 142 | if (die || help) { 143 | std::cerr << "\n" << CONVERT_USAGE_MESSAGE; 144 | die ? exit(EXIT_FAILURE) : exit(EXIT_SUCCESS); 145 | } 146 | 147 | 148 | } 149 | 150 | static void read_bx(std::string& bx, const SeqLib::BamRecord& r) { 151 | if (!r.GetZTag(opt::tag, bx)) 152 | bx = empty_tag; 153 | std::replace(bx.begin(), bx.end(), '-', '_'); 154 | assert(!bx.empty()); 155 | } 156 | -------------------------------------------------------------------------------- /src/bxconvert.h: -------------------------------------------------------------------------------- 1 | #ifndef BXTOOLS_CONVERT_H__ 2 | #define BXTOOLS_CONVERT_H__ 3 | 4 | static void parseOptions(int argc, char** argv); 5 | void runConvert(int argc, char** argv); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /src/bxgroup.cpp: -------------------------------------------------------------------------------- 1 | #include "bxgroup.h" 2 | 3 | #include "bxcommon.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "SeqLib/BamReader.h" 10 | #include "SeqLib/BamWriter.h" 11 | 12 | struct BXGroup { 13 | 14 | int start; 15 | int stop; 16 | std::string tag; 17 | SeqLib::BamRecordVector buff; 18 | 19 | BXGroup() : start(0), stop(0), tag("MI") {} 20 | 21 | int width() const { return stop - start; } 22 | }; 23 | 24 | namespace opt { 25 | 26 | static std::string bam; // the bam to group 27 | static bool verbose = false; 28 | static std::string tag = "BX"; // tag to group by 29 | } 30 | 31 | static const char* shortopts = "hvxb:a:m:t:"; 32 | static const struct option longopts[] = { 33 | { "help", no_argument, NULL, 'h' }, 34 | { "no-output", no_argument, NULL, 'x' }, 35 | { "verbose", no_argument, NULL, 'v' }, 36 | { "min-reads", required_argument, NULL, 'm' }, 37 | { "tag", required_argument, NULL, 't' }, 38 | { NULL, 0, NULL, 0 } 39 | }; 40 | 41 | static const char *GROUP_USAGE_MESSAGE = 42 | "Usage: bxtools group \n" 43 | "Description: Group BX tags that are adjacent\n" 44 | "\n" 45 | " General options\n" 46 | " -v, --verbose Select verbosity level (0-4). Default: 0 \n" 47 | " -h, --help Display this help and exit\n" 48 | "\n"; 49 | 50 | static void parseOptions(int argc, char** argv) { 51 | 52 | bool die = false; 53 | 54 | if (argc < 2) 55 | die = true; 56 | else 57 | opt::bam = std::string(argv[1]); 58 | 59 | bool help = false; 60 | std::stringstream ss; 61 | 62 | for (char c; (c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1;) { 63 | std::istringstream arg(optarg != NULL ? optarg : ""); 64 | switch (c) { 65 | case 'v': opt::verbose = true; break; 66 | case 't': arg >> opt::tag; break; 67 | } 68 | } 69 | 70 | if (die || help) { 71 | std::cerr << "\n" << GROUP_USAGE_MESSAGE; 72 | die ? exit(EXIT_FAILURE) : exit(EXIT_SUCCESS); 73 | } 74 | } 75 | 76 | void runGroup(int argc, char** argv) { 77 | 78 | std::cerr << "!! NOT YET IMPLEMENTED !!" << std::endl; 79 | return; 80 | 81 | parseOptions(argc, argv); 82 | 83 | // opeen the BAM 84 | SeqLib::BamReader reader; 85 | if (!reader.Open(opt::bam)) { 86 | std::cerr << "Failed to open bam: " << opt::bam << std::endl; 87 | exit(EXIT_FAILURE); 88 | } 89 | 90 | // loop and write 91 | SeqLib::BamRecord r; 92 | size_t count = 0; 93 | bool hit = false; 94 | while (reader.GetNextRecord(r)) { 95 | 96 | ++count; 97 | 98 | // sanity check 99 | BXLOOPCHECK(r, hit, opt::tag) 100 | 101 | std::string bx; 102 | r.GetTag(opt::tag, bx); 103 | if (bx.empty()) { 104 | continue; 105 | } else { 106 | hit = true; 107 | } 108 | 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /src/bxgroup.h: -------------------------------------------------------------------------------- 1 | #ifndef BXTOOLS_BXGROUP 2 | #define BXTOOLS_BXGROUP 3 | 4 | static void parseOptions(int argc, char** argv); 5 | void runGroup(int argc, char** argv); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /src/bxmol.cpp: -------------------------------------------------------------------------------- 1 | #include "bxmol.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "SeqLib/BamReader.h" 8 | #include "SeqLib/GenomicRegionCollection.h" 9 | 10 | #include "bxcommon.h" 11 | 12 | namespace opt { 13 | 14 | static std::string bam; // the bam to analyze 15 | static bool verbose = false; 16 | static std::string tag = "BX"; 17 | } 18 | 19 | static const char* shortopts = "hvt:"; 20 | static const struct option longopts[] = { 21 | { "help", no_argument, NULL, 'h' }, 22 | { "verbose", no_argument, NULL, 'v' }, 23 | { "tag", required_argument, NULL, 't' }, 24 | { NULL, 0, NULL, 0 } 25 | }; 26 | 27 | static const char *MOL_USAGE_MESSAGE = 28 | "Usage: bxtools mol > mol.bed\n" 29 | "Description: Return span of molecules from 10X data (using MI tag)\n" 30 | "\n" 31 | " General options\n" 32 | " -v, --verbose Set verbose output\n" 33 | " -t, --tag Use a different tag other than MI\n" 34 | "\n"; 35 | 36 | class BXMol { 37 | 38 | public: 39 | 40 | BXMol() {} 41 | 42 | int min = INT_MAX; 43 | int max = -1; 44 | int chr = -1; 45 | 46 | std::unordered_set bx; // BX tag 47 | //std::string bx; // BX tag 48 | std::string mi; // MI (or -t) tag 49 | std::string tmpbx; // tmp to be overwritted to hold new bx 50 | 51 | int nr = 0; // num reads 52 | std::string chr_string; 53 | 54 | bool add(const SeqLib::BamRecord& r, const SeqLib::BamHeader h) { 55 | 56 | if (chr > 0 && chr != r.ChrID()) { 57 | std::cerr << "Warning: " << opt::tag << " " << mi << " spans multiple chromosomes" << std::endl; 58 | return false; 59 | } 60 | 61 | 62 | r.GetTag(opt::tag, mi); 63 | 64 | ++nr; 65 | 66 | // get the BX tag 67 | r.GetTag("BX", tmpbx); 68 | bx.insert(tmpbx); 69 | 70 | // set the position 71 | chr = r.ChrID(); 72 | min = std::min(r.Position(), min); 73 | max = std::max(r.PositionEnd(), max); 74 | if (chr_string.empty()) 75 | chr_string = h.IDtoName(chr); 76 | 77 | return true; 78 | 79 | } 80 | 81 | friend std::ostream& operator<<(std::ostream& out, const BXMol& b) { 82 | std::stringstream ss; 83 | for (auto& i : b.bx) 84 | ss << i << ","; 85 | std::string bxstring = ss.str(); 86 | if (!bxstring.empty()) 87 | bxstring.pop_back(); // remove last comma 88 | out << b.chr_string << "\t" << b.min << "\t" 89 | << b.max << "\t" << b.mi << "\t" << bxstring << "\t" 90 | << b.nr; 91 | return out; 92 | } 93 | 94 | }; 95 | 96 | static void parseOptions(int argc, char** argv); 97 | 98 | void runMol(int argc, char** argv) { 99 | 100 | parseOptions(argc, argv); 101 | 102 | SeqLib::BamReader reader; 103 | BXOPEN(reader, opt::bam); 104 | SeqLib::BamHeader hdr = reader.Header(); 105 | 106 | std::unordered_map molmap; 107 | 108 | SeqLib::BamRecord r; 109 | size_t count = 0; 110 | std::string mi; 111 | //int32_t mi; 112 | while (reader.GetNextRecord(r)) { 113 | BXLOOPCHECK(r, molmap.size(), opt::tag); 114 | if (r.MappedFlag() && r.GetTag(opt::tag, mi)) 115 | molmap[mi].add(r, hdr); 116 | } 117 | // print them out as a BED 118 | for (const auto& b : molmap) 119 | std::cout << b.second << std::endl; 120 | } 121 | 122 | static void parseOptions(int argc, char** argv) { 123 | 124 | bool die = false; 125 | bool help = false; 126 | 127 | if (argc < 2) 128 | die = true; 129 | else 130 | opt::bam = std::string(argv[1]); 131 | 132 | std::stringstream ss; 133 | 134 | for (char c; (c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1;) { 135 | std::istringstream arg(optarg != NULL ? optarg : ""); 136 | switch (c) { 137 | case 'v': opt::verbose = true; break; 138 | case 'h': help = true; break; 139 | case 't': arg >> opt::tag; break; 140 | } 141 | } 142 | 143 | if (die || help) { 144 | std::cerr << "\n" << MOL_USAGE_MESSAGE; 145 | die ? exit(EXIT_FAILURE) : exit(EXIT_SUCCESS); 146 | } 147 | 148 | } 149 | 150 | -------------------------------------------------------------------------------- /src/bxmol.h: -------------------------------------------------------------------------------- 1 | #ifndef BXTOOLS_MOL_H 2 | #define BXTOOLS_MOL_H 3 | 4 | void runMol(int argc, char** argv); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/bxrelabel.cpp: -------------------------------------------------------------------------------- 1 | #include "bxrelabel.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "SeqLib/BamReader.h" 9 | #include "SeqLib/BamWriter.h" 10 | 11 | namespace opt { 12 | static std::string bam; // the bam to rename 13 | static bool verbose = false; 14 | } 15 | 16 | static const char* shortopts = "hv"; 17 | static const struct option longopts[] = { 18 | { "help", no_argument, NULL, 'h' }, 19 | { "verbose", no_argument, NULL, 'v' }, 20 | { NULL, 0, NULL, 0 } 21 | }; 22 | 23 | static const char *RELABEL_USAGE_MESSAGE = 24 | "Usage: bxtools relabel input.bam > relabeled.bam \n" 25 | "Description: Move BX barcodes from BX tag to qname\n" 26 | "\n" 27 | " General options\n" 28 | " -v, --verbose Select verbosity level (0-4). Default: 0 \n" 29 | " -h, --help Display this help and exit\n" 30 | "\n"; 31 | 32 | static void parseOptions(int argc, char** argv) { 33 | 34 | bool die = false; 35 | if (argc < 2) 36 | die = true; 37 | else 38 | opt::bam = std::string(argv[1]); 39 | 40 | bool help = false; 41 | std::stringstream ss; 42 | 43 | for (char c; (c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1;) { 44 | std::istringstream arg(optarg != NULL ? optarg : ""); 45 | switch (c) { 46 | case 'v': opt::verbose = true; break; 47 | } 48 | } 49 | 50 | if (die || help) { 51 | std::cerr << "\n" << RELABEL_USAGE_MESSAGE; 52 | die ? exit(EXIT_FAILURE) : exit(EXIT_SUCCESS); 53 | } 54 | } 55 | 56 | static void parseOptions(int argc, char** argv); 57 | 58 | void runRelabel(int argc, char** argv) { 59 | 60 | parseOptions(argc, argv); 61 | 62 | // open the read BAM 63 | SeqLib::BamReader reader; 64 | if (!reader.Open(opt::bam)) { 65 | std::cerr << "Failed to open bam: " << opt::bam << std::endl; 66 | exit(EXIT_FAILURE); 67 | } 68 | 69 | // open the write BAM 70 | SeqLib::BamWriter w; 71 | if (!w.Open("-")) { 72 | std::cerr << "Failed to open output stream" << std::endl; 73 | exit(EXIT_FAILURE); 74 | } 75 | w.SetHeader(reader.Header()); 76 | w.WriteHeader(); 77 | 78 | // loop and write 79 | SeqLib::BamRecord r; 80 | size_t count = 0; 81 | bool bxtaghit = false; 82 | while (reader.GetNextRecord(r)) { 83 | 84 | ++count; 85 | 86 | // sanity check 87 | if (count == 100000 && !bxtaghit) 88 | std::cerr << "****1e5 reads in and haven't hit BX tag yet****" << std::endl; 89 | 90 | std::string bx; 91 | r.GetZTag("BX", bx); 92 | if (bx.empty()) { 93 | if (opt::verbose) 94 | std::cerr << "BX tag empty for read: " << r << std::endl; 95 | continue; 96 | } else { 97 | bxtaghit = true; 98 | } 99 | 100 | if (count % 1000000 == 0 && opt::verbose) 101 | std::cerr << "...at read " << SeqLib::AddCommas(count) << " at pos " << r.Brief() << std::endl; 102 | 103 | // set the read name with the BX tag, remove the old one 104 | r.SetQname(r.Qname() + "_" + bx); 105 | r.RemoveTag("BX"); 106 | 107 | if (!w.WriteRecord(r)) { 108 | std::cerr << "failed to write read " << r << " to BAM for " << bx << std::endl; 109 | exit(EXIT_FAILURE); 110 | } 111 | } 112 | 113 | w.Close(); 114 | } 115 | -------------------------------------------------------------------------------- /src/bxrelabel.h: -------------------------------------------------------------------------------- 1 | #ifndef BXTOOLS_BXRELABEL_H__ 2 | #define BXTOOLS_BXRELABEL_H__ 3 | 4 | void runRelabel(int argc, char** argv); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/bxsplit.cpp: -------------------------------------------------------------------------------- 1 | #include "bxsplit.h" 2 | 3 | #include "bxcommon.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "SeqLib/BamReader.h" 10 | #include "SeqLib/BamWriter.h" 11 | 12 | struct BXTag { 13 | 14 | SeqLib::BamWriter w; 15 | size_t count = 0; 16 | SeqLib::BamRecordVector buff; 17 | }; 18 | 19 | namespace opt { 20 | 21 | static std::string bam; // the bam to split 22 | static std::string analysis_id = "foo"; // unique prefix for output 23 | static bool verbose = false; 24 | static bool noop = false; // dont write bams, just count 25 | static int min = 0; // minimum number of reads before writing 26 | static std::string tag = "BX"; // tag to split by 27 | static bool include_empty = false; // output BAM with empty reads 28 | } 29 | 30 | static const char* shortopts = "hvxeb:a:m:t:"; 31 | static const struct option longopts[] = { 32 | { "help", no_argument, NULL, 'h' }, 33 | { "no-output", no_argument, NULL, 'x' }, 34 | { "analysis-id", required_argument, NULL, 'a' }, 35 | { "verbose", no_argument, NULL, 'v' }, 36 | { "include-empty", no_argument, NULL, 'e' }, 37 | { "min-reads", required_argument, NULL, 'm' }, 38 | { "tag", required_argument, NULL, 't' }, 39 | { NULL, 0, NULL, 0 } 40 | }; 41 | 42 | static const char *SPLIT_USAGE_MESSAGE = 43 | "Usage: bxtools split -a > bxcounts.tsv\n" 44 | "Description: Split / count a BAM into multiple BAMs, one BAM per unique BX tag\n" 45 | "\n" 46 | " General options\n" 47 | " -v, --verbose Select verbosity level (0-4). Default: 0 \n" 48 | " -h, --help Display this help and exit\n" 49 | " -a, --analysis-id ID to prefix output files with [foo]\n" 50 | " -x, --no-output Don't output BAMs (count only) [off]\n" 51 | " -m, --min-reads Minumum reads of given tag to see before writing [0]\n" 52 | " -t, --tag Split by a tag other than BX (e.g. MI)\n" 53 | " -e, --include-empty Output a BAM with all of the reads with empty tag\n" 54 | "\n"; 55 | 56 | void parseSplitOptions(int argc, char** argv) { 57 | 58 | bool die = false; 59 | 60 | if (argc < 2) 61 | die = true; 62 | else 63 | opt::bam = std::string(argv[1]); 64 | 65 | bool help = false; 66 | std::stringstream ss; 67 | 68 | for (char c; (c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1;) { 69 | std::istringstream arg(optarg != NULL ? optarg : ""); 70 | switch (c) { 71 | case 'a': arg >> opt::analysis_id; break; 72 | case 'v': opt::verbose = true; break; 73 | case 'x': opt::noop = true; break; 74 | case 'e': opt::include_empty = true; break; 75 | case 'm': arg >> opt::min; break; 76 | case 't': arg >> opt::tag; break; 77 | } 78 | } 79 | 80 | if (die || help) { 81 | std::cerr << "\n" << SPLIT_USAGE_MESSAGE; 82 | die ? exit(EXIT_FAILURE) : exit(EXIT_SUCCESS); 83 | } 84 | } 85 | 86 | void runSplit(int argc, char** argv) { 87 | 88 | parseSplitOptions(argc, argv); 89 | 90 | // opeen the BAM 91 | SeqLib::BamReader reader; 92 | if (!reader.Open(opt::bam)) { 93 | std::cerr << "Failed to open bam: " << opt::bam << std::endl; 94 | exit(EXIT_FAILURE); 95 | } 96 | 97 | // make a collection of writers 98 | std::unordered_map tags; 99 | 100 | // loop and write 101 | SeqLib::BamRecord r; 102 | size_t count = 0; 103 | bool hit = false; 104 | while (reader.GetNextRecord(r)) { 105 | 106 | ++count; 107 | 108 | // sanity check 109 | BXLOOPCHECK(r, hit, opt::tag) 110 | 111 | std::string bx; 112 | r.GetTag(opt::tag, bx); 113 | if (bx.empty()) { 114 | if (!opt::include_empty) 115 | continue; 116 | bx="bxe"; // bxtools empty 117 | } else { 118 | hit = true; 119 | } 120 | 121 | ++tags[bx].count; 122 | 123 | if (opt::noop) 124 | continue; 125 | 126 | if (tags[bx].count < opt::min) { 127 | tags[bx].buff.push_back(r); 128 | continue; 129 | } 130 | 131 | // have a buffer to clear or hit first read with no min 132 | if (tags[bx].buff.size() || (opt::min <= 0 && tags[bx].count == 1)) { 133 | 134 | // need to establish a new writer? 135 | std::string bname = opt::analysis_id + "." + bx + ".bam"; 136 | if (!tags[bx].w.Open(bname)) { 137 | std::cerr << "Could not open BAM: " << bname << std::endl; 138 | exit(EXIT_FAILURE); 139 | } 140 | 141 | std::cerr << "creating new output BAM: " << bname << std::endl; 142 | tags[bx].w.SetHeader(reader.Header()); 143 | tags[bx].w.WriteHeader(); 144 | for (const auto& rr : tags[bx].buff) 145 | tags[bx].w.WriteRecord(rr); 146 | tags[bx].buff.clear(); 147 | continue; 148 | } 149 | 150 | if (!tags[bx].w.WriteRecord(r)) { 151 | std::cerr << "failed to write read " << r << " to BAM for " << bx << std::endl; 152 | exit(EXIT_FAILURE); 153 | } 154 | 155 | } 156 | 157 | // print the final counts to std::out 158 | for (const auto& b : tags) 159 | std::cout << b.first << "\t" << b.second.count << std::endl; 160 | 161 | } 162 | -------------------------------------------------------------------------------- /src/bxsplit.h: -------------------------------------------------------------------------------- 1 | #ifndef BXTOOLS_BXSPLIT_H__ 2 | #define BXTOOLS_BXSPLIT_H__ 3 | 4 | void parseSplitOptions(int argc, char** argv); 5 | void runSplit(int argc, char** argv); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /src/bxstats.cpp: -------------------------------------------------------------------------------- 1 | #include "bxstats.h" 2 | 3 | #include "bxcommon.h" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include "SeqLib/BamReader.h" 10 | 11 | namespace opt { 12 | 13 | static std::string bam; // the bam to analyze 14 | static bool verbose = false; 15 | static std::string tag = "BX"; // tag to split by 16 | } 17 | 18 | static const char* shortopts = "hvt:"; 19 | static const struct option longopts[] = { 20 | { "help", no_argument, NULL, 'h' }, 21 | { "tag", required_argument, NULL, 't' }, 22 | { "bam", required_argument, NULL, 'b' }, 23 | { NULL, 0, NULL, 0 } 24 | }; 25 | 26 | static const char *STAT_USAGE_MESSAGE = 27 | "Usage: bxtools stat > stats.tsv\n" 28 | "Description: Gather BX-level statistics\n" 29 | "\n" 30 | " General options\n" 31 | " -v, --verbose Set verbose output\n" 32 | " -t, --tag Collect stats by a tag other than BX (e.g. MI)\n" 33 | "\n"; 34 | 35 | static void parseOptions(int argc, char** argv); 36 | 37 | void runStat(int argc, char** argv) { 38 | 39 | parseOptions(argc, argv); 40 | 41 | // open the BAM 42 | SeqLib::BamReader reader; 43 | if (!reader.Open(opt::bam)) { 44 | std::cerr << "Failed to open bam: " << opt::bam << std::endl; 45 | exit(EXIT_FAILURE); 46 | } 47 | 48 | std::unordered_map bxstats; 49 | 50 | // loop and collect 51 | SeqLib::BamRecord r; 52 | size_t count = 0; 53 | while (reader.GetNextRecord(r)) { 54 | std::string bx; 55 | bool tag_present = r.GetTag(opt::tag, bx); 56 | 57 | BXLOOPCHECK(r, bxstats.size(), opt::tag) 58 | 59 | if (!tag_present) 60 | continue; 61 | 62 | ++bxstats[bx].count; 63 | bxstats[bx].bx = bx; 64 | if (r.PairMappedFlag() && !r.Interchromosomal()) 65 | bxstats[bx].isize.push_back(std::abs(r.InsertSize())); 66 | if (r.MappedFlag()) 67 | bxstats[bx].mapq.push_back(std::abs(r.MapQuality())); 68 | 69 | int as_int = -1; 70 | float as_float = -1; 71 | std::string as_string = "NA"; 72 | if (r.GetIntTag("AS", as_int)) { 73 | bxstats[bx].as.push_back(as_int); 74 | } else if (r.GetFloatTag("AS", as_float)) { 75 | const std::string tt = "AS"; 76 | bxstats[bx].as.push_back(as_float); 77 | } else if (r.GetZTag("AS", as_string)) { 78 | try { 79 | bxstats[bx].as.push_back(std::stof(as_string)); 80 | } catch (...) { 81 | std::cerr << "Could not convert AS:Z val of " << as_string << " to float" << std::endl; 82 | } 83 | } 84 | 85 | } 86 | 87 | for (const auto& b : bxstats) 88 | std::cout << b.second << std::endl; 89 | 90 | } 91 | 92 | static void parseOptions(int argc, char** argv) { 93 | 94 | bool die = false; 95 | bool help = false; 96 | 97 | if (argc < 2) 98 | die = true; 99 | else 100 | opt::bam = std::string(argv[1]); 101 | 102 | for (char c; (c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1;) { 103 | std::istringstream arg(optarg != NULL ? optarg : ""); 104 | switch (c) { 105 | case 'v': opt::verbose = true; break; 106 | case 't': arg >> opt::tag; break; 107 | case 'h': help = true; break; 108 | } 109 | } 110 | 111 | if (die || help) { 112 | std::cerr << "\n" << STAT_USAGE_MESSAGE; 113 | die ? exit(EXIT_FAILURE) : exit(EXIT_SUCCESS); 114 | } 115 | 116 | } 117 | 118 | //http://stackoverflow.com/questions/2114797/compute-median-of-values-stored-in-vector-c 119 | template 120 | static double CalcMHWScore(std::vector scores) { 121 | double median; 122 | size_t size = scores.size(); 123 | 124 | std::sort(scores.begin(), scores.end()); 125 | 126 | if (size % 2 == 0) 127 | median = (scores[size / 2 - 1] + scores[size / 2]) / 2; 128 | else 129 | median = scores[size / 2]; 130 | 131 | return median; 132 | } 133 | 134 | std::ostream& operator<<(std::ostream& out, const BXStat& b) { 135 | double isize_med = -1; 136 | double mapq_med = -1; 137 | double as_med = -1; 138 | if (b.isize.size()) 139 | isize_med = CalcMHWScore(b.isize); 140 | if (b.mapq.size()) 141 | mapq_med = CalcMHWScore(b.mapq); 142 | if (b.as.size()) 143 | as_med = CalcMHWScore(b.as); 144 | out << b.bx << "\t" << b.count << "\t" << isize_med << "\t" << mapq_med 145 | << "\t" << as_med; 146 | return out; 147 | } 148 | 149 | -------------------------------------------------------------------------------- /src/bxstats.h: -------------------------------------------------------------------------------- 1 | #ifndef BXTOOLS_STATS_H__ 2 | #define BXTOOLS_STATS_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | void runStat(int argc, char** argv); 11 | 12 | struct BXStat { 13 | 14 | std::string bx; // label 15 | size_t count; // number of reads 16 | std::vector isize; // insert size 17 | std::vector mapq; // mapping quality 18 | std::vector as; // alignment quality 19 | 20 | friend std::ostream& operator<<(std::ostream& out, const BXStat& b); 21 | 22 | }; 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/bxtile.cpp: -------------------------------------------------------------------------------- 1 | #include "bxtile.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "SeqLib/BamReader.h" 8 | #include "SeqLib/GenomicRegionCollection.h" 9 | 10 | #include "bxcommon.h" 11 | 12 | namespace opt { 13 | 14 | static std::string bam; // the bam to analyze 15 | static bool verbose = false; 16 | static int width = 1000; 17 | static int overlap = 0; 18 | static std::string bed; // optional bed file 19 | static std::string tag = "BX"; // tag to split by 20 | } 21 | 22 | static const char* shortopts = "hvw:O:b:t:"; 23 | static const struct option longopts[] = { 24 | { "help", no_argument, NULL, 'h' }, 25 | { "bed", required_argument, NULL, 'b' }, 26 | { "pad", required_argument, NULL, 'p' }, 27 | { "width", required_argument, NULL, 'w' }, 28 | { "overlap", required_argument, NULL, 'O' }, 29 | { "tag", required_argument, NULL, 't' }, 30 | { NULL, 0, NULL, 0 } 31 | }; 32 | 33 | static const char *TILE_USAGE_MESSAGE = 34 | "Usage: bxtools tile > tiles.bed\n" 35 | "Description: Gather BX counts on tiled ranges\n" 36 | "\n" 37 | " General options\n" 38 | " -v, --verbose Set verbose output\n" 39 | " -w, --width Width of the tile [1000]\n" 40 | " -O, --overlap Overlap of the tiles [0]\n" 41 | " -b, --bed Rather than tile genome, input BED with regions\n" 42 | " -t, --tag Tag other than BX to evaluate (e.g. MI)\n" 43 | "\n"; 44 | 45 | class BXRegion : public SeqLib::GenomicRegion { 46 | 47 | public: 48 | 49 | BXRegion() : GenomicRegion() {} 50 | 51 | BXRegion(const std::string c, const std::string p1, const std::string p2, 52 | const SeqLib::BamHeader& h) : GenomicRegion(c, p1, p2, h) {} 53 | 54 | std::unordered_map counts; 55 | 56 | std::string ToBEDString(const SeqLib::BamHeader& h) const { 57 | std::string out = h.IDtoName(chr) + "\t" + std::to_string(pos1) + 58 | "\t" + std::to_string(pos2); 59 | if (counts.size()) 60 | out += "\t"; 61 | for (const auto& b : counts) 62 | out += b.first + "_" + std::to_string(b.second) + ","; 63 | if (counts.size()) 64 | out.pop_back(); // erase last comma 65 | return out; 66 | } 67 | }; 68 | 69 | static void parseOptions(int argc, char** argv); 70 | 71 | void runTile(int argc, char** argv) { 72 | 73 | parseOptions(argc, argv); 74 | 75 | SeqLib::BamReader reader; 76 | BXOPEN(reader, opt::bam); 77 | SeqLib::BamHeader hdr = reader.Header(); 78 | 79 | SeqLib::GenomicRegionCollection * tiles = nullptr; 80 | if (!opt::bed.empty()) { 81 | tiles = new SeqLib::GenomicRegionCollection(); 82 | tiles->ReadBED(opt::bed, hdr); 83 | tiles->CreateTreeMap(); 84 | } else { 85 | // tile it 86 | std::cerr << "...creating tiles with width " << 87 | SeqLib::AddCommas(opt::width) << " and overlap " << SeqLib::AddCommas(opt::overlap) << std::endl; 88 | tiles = new SeqLib::GenomicRegionCollection(opt::width, opt::overlap, hdr.GetHeaderSequenceVector()); 89 | std::cerr << "...created " << SeqLib::AddCommas(tiles->size()) << " tiles" << std::endl; 90 | std::cerr << "...sorting and creating interval tree" << std::endl; 91 | tiles->CreateTreeMap(); 92 | } 93 | 94 | std::cerr << "...reading input" << std::endl; 95 | SeqLib::BamRecord r; 96 | size_t count = 0; 97 | size_t bxcount = 0; 98 | while (reader.GetNextRecord(r)) { 99 | std::string bx; 100 | r.GetTag(opt::tag, bx); 101 | BXLOOPCHECK(r, bxcount, opt::tag); 102 | if (bx.empty()) 103 | continue; 104 | 105 | if (r.MappedFlag()) { 106 | std::vector bins = tiles->FindOverlappedIntervals(r.AsGenomicRegion(), true); 107 | for (const auto& b : bins) 108 | ++(*tiles)[b].counts[bx]; 109 | ++bxcount; 110 | } 111 | 112 | } 113 | 114 | for (const auto& b : *tiles) 115 | std::cout << b.ToBEDString(hdr) << std::endl; 116 | 117 | if (tiles) 118 | delete tiles; 119 | 120 | } 121 | 122 | static void parseOptions(int argc, char** argv) { 123 | 124 | bool die = false; 125 | bool help = false; 126 | 127 | if (argc < 2) 128 | die = true; 129 | else 130 | opt::bam = std::string(argv[1]); 131 | 132 | std::stringstream ss; 133 | 134 | for (char c; (c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1;) { 135 | std::istringstream arg(optarg != NULL ? optarg : ""); 136 | switch (c) { 137 | case 'v': opt::verbose = true; break; 138 | case 'h': help = true; break; 139 | case 'w': arg >> opt::width; break; 140 | case 'O': arg >> opt::overlap; break; 141 | case 'b': arg >> opt::bed; break; 142 | case 't': arg >> opt::tag; break; 143 | } 144 | } 145 | 146 | if (die || help) { 147 | std::cerr << "\n" << TILE_USAGE_MESSAGE; 148 | die ? exit(EXIT_FAILURE) : exit(EXIT_SUCCESS); 149 | } 150 | 151 | } 152 | 153 | -------------------------------------------------------------------------------- /src/bxtile.h: -------------------------------------------------------------------------------- 1 | #ifndef BXTOOLS_TILE_H__ 2 | #define BXTOOLS_TILE_H__ 3 | 4 | void runTile(int argc, char** argv); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/bxtools.cpp: -------------------------------------------------------------------------------- 1 | /* bxtools - Tools for analyzing 10X genomics data 2 | * Copyright 2016 Jeremiah Wala 3 | * Written by Jeremiah Wala (jwala@broadinstitute.org) 4 | * Released under the MIT license 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | static const char *USAGE_MESSAGE = 17 | "Program: bxtools \n" 18 | "Contact: Jeremiah Wala [ jwala@broadinstitute.org ]\n" 19 | "Usage: snowman [options]\n\n" 20 | "Commands:\n" 21 | " split Split a BAM into multiple BAMs, one per BX tag\n" 22 | " stats Collect BX-level statistics across a BAM\n" 23 | " tile Collect BX-level coverage in tiles or regions along genome\n" 24 | " group Group together BX tags into molecules\n" 25 | " relabel Move BX barcodes from BX tags (e.g. BX:TAATACG) to qname_TAATACG\n" 26 | " mol Output BED with footprint of each molecule (from MI tag)\n" 27 | " convert Flip the BX tag and chromosome, so as to allow for a BX-sorted and indexable BAM\n" 28 | "\nReport bugs to jwala@broadinstitute.org \n\n"; 29 | 30 | int main(int argc, char** argv) { 31 | 32 | if (argc <= 1) { 33 | std::cerr << USAGE_MESSAGE; 34 | return 0; 35 | } else { 36 | std::string command(argv[1]); 37 | if (command == "help" || command == "--help") { 38 | std::cerr << USAGE_MESSAGE; 39 | return 0; 40 | } else if (command == "split") { 41 | runSplit(argc -1, argv + 1); 42 | } else if (command == "stats") { 43 | runStat(argc -1, argv + 1); 44 | } else if (command == "tile") { 45 | runTile(argc -1, argv + 1); 46 | } else if (command == "relabel") { 47 | runRelabel(argc -1, argv + 1); 48 | } else if (command == "convert"){ 49 | runConvert(argc -1, argv + 1); 50 | } else if (command == "group") { 51 | runGroup(argc -1, argv + 1); 52 | } else if (command == "mol") { 53 | runMol(argc -1, argv + 1); 54 | } 55 | else { 56 | std::cerr << USAGE_MESSAGE; 57 | return 0; 58 | } 59 | } 60 | 61 | return 0; 62 | 63 | } 64 | --------------------------------------------------------------------------------