File: faq.rst

package info (click to toggle)
bedtools 2.26.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 55,328 kB
  • sloc: cpp: 37,989; sh: 6,930; makefile: 2,225; python: 163
file content (169 lines) | stat: -rw-r--r-- 5,218 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
############
FAQ
############


====================
Installation issues
====================

--------------------------------------------------
Why am I getting all of these zlib errors?
--------------------------------------------------

On certain operating systems (especially free Linux distributions) the complete
zlib libraries are not installed.  Bedtools depends upon zlib in order to 
decompress gzipped files.  

.. code-block:: bash

    - Building main bedtools binary.
    obj/gzstream.o: In function gzstreambuf::open(char const*, int):
    gzstream.C:(.text+0x2a5): undefined reference to gzopen64'
    collect2: ld returned 1 exit status
    make: *** [all] Error 1
    
If you see an error such as the above, it suggests you need to install the
``zlib`` and ``zlib1g-dev`` libraries.  This is typically straightforward using
package managers.  For example, on Debian/Ubuntu this would be:

.. code-block:: bash
    
    apt-get install zlib
    apt-get install zlib1g-dev

and on Fedora/Centos this would be:

.. code-block:: bash
    
    yum install zlib
    yum install zlib1g-dev



====================
General questions
====================


--------------------------------------------------
How do I know what version of bedtools I am using?
--------------------------------------------------

Use the --version option.

.. code-block:: bash

    $ bedtools --version
    bedtools v2.17.0


--------------------------------------------------
How do I bring up the help/usage menu?
--------------------------------------------------

To receive a high level list of available tools in bedtools, use ```-h``:

.. code-block:: bash

    $ bedtools -h
    bedtools: flexible tools for genome arithmetic and DNA sequence analysis.
    usage:    bedtools <subcommand> [options]
    
    The bedtools sub-commands include:
    
    [ Genome arithmetic ]
        intersect     Find overlapping intervals in various ways.
        window        Find overlapping intervals within a window around an interval.
        closest       Find the closest, potentially non-overlapping interval.
        coverage      Compute the coverage over defined intervals.
        map           Apply a function to a column for each overlapping interval.
        genomecov     Compute the coverage over an entire genome.
        merge         Combine overlapping/nearby intervals into a single interval.
        cluster       Cluster (but don't merge) overlapping/nearby intervals.
        complement    Extract intervals _not_ represented by an interval file.
    ...

To display the help for a specific tool (e.g., ``bedtools shuffle``), use:

.. code-block:: bash

    $ bedtools merge -h
    
    Tool:    bedtools merge (aka mergeBed)
    Version: v2.17.0
    Summary: Merges overlapping BED/GFF/VCF entries into a single interval.
    
    Usage:   bedtools merge [OPTIONS] -i <bed/gff/vcf>
    
    Options: 
    	-s	Force strandedness.  That is, only merge features
    		that are the same strand.
    		- By default, merging is done without respect to strand.
    
    	-n	Report the number of BED entries that were merged.
    		- Note: "1" is reported if no merging occurred.



            

====================
Issues with output
====================

------------------------------------------------------------------------
I *know* there are overlaps, but none are reported. What might be wrong?
------------------------------------------------------------------------

There are two common causes of this problem.  The first cause is non-obvious 
differences in the way chromosomes are named in files being compared.  
For example, "1" is not the same as "chr1" just as "   chr1" is not the same 
as "chr1".  Secondly, users often copy files from a Windows machine to a UNIX 
machine.  This causes issues because Windows uses two bytes to represent
the end of a line (``\r\n``) whereas the UNIX convention uses a single byte
(``\n``).  If your files don't conform to the UNIX convention, you will have 
problems.  One can convert files from Windows to UNIX with
the following command:

.. code-block:: bash

   perl -i -p -e 's/\r\n/\n/g;' file.windows > file.unix



====================
Installation issues
====================


---------------------------------------------------------------------------
Bedtools compilation fails with errors related to zlib.  How do I fix this?
---------------------------------------------------------------------------

Some systems, especially Ubuntu, do not come pre-installed with up to date
versions of the zlib compression utilities that tools such as `bedtools` and
`samtools` depend upon. This can cause compilation errors when you try to 
compile `bedtools`.  Errors include:

.. code-block:: bash

    ../utils//gzstream/gzstream.h:50: error: ‘gzFile’ does not name a type 
    

or

.. code-block:: bash

    fatal error: zlib.h: No such file or directory  

This indicates that you need to install the zlib libraries on your system, which
turns out to not be too difficult through the use of package installers.  For
example, on Ubuntu, you'd want to run:

.. code-block:: bash

    sudo apt-get install zlib1g-dev
    sudo apt-get install zlib