Learning how to use Samtools
1
0
Entering edit mode
3.5 years ago
kimkes25 ▴ 50

Hello.

I am working with narrowpeak and bed files. I want to use samtools in order to index( tabix) the files.

I want to use it also in order to conduct queries on my files.

The documentation in the website is not so informative and doesn't refer my type of files directly. How can I learn how to use samtools in a clear way? Is there any apaproachable tutorial? Thanks

samtools • 716 views
ADD COMMENT
3
Entering edit mode
3.5 years ago
ATpoint 82k

What exactly is unclear? The problem with the files in your previous questions was that they were not in BED format because they had a header. BED format is chr-start-end at minimum in a tab-separated file. If you have a strand information it must be in column 6, all other columns can contain any value. narrowPeak is in fact a BED 6+4 file and follows the same conventions.

Querying can be done with tabix:

$ cat test.bed
chr1    1   10  .   dump    +
chr1    100 200 .   trump   -
chr2    1000    2000    .   chicken +

$ bgzip test.bed 
$ tabix -p bed test.bed.gz
$ tabix test.bed.gz chr1
  chr1  1   10  .   dump    +
  chr1  100 200 .   trump   -

In general: tabix your.file.gz chr:start-end

You can also query other file types such as VCF and GFF, please see the manual and you can provide a file that lists the query regions rather than providing them directly with the above command. Type tabix into the console and the help pops up.

ADD COMMENT

Login before adding your answer.

Traffic: 3182 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6