Questions tagged [samtools]

Samtools is a suite of programs for interacting with high-throughput sequencing data.

Samtools is a suite of programs for interacting with high-throughput sequencing data. It consists of three separate repositories:

  1. Samtools Reading/writing/editing/indexing/viewing SAM/BAM/CRAM format
  2. Reading/writing BCF2/VCF/gVCF files and calling/filtering/summarising SNP and short indel sequence variants
  3. HTSlib A C library for reading/writing high-throughput sequencing data Samtools and BCFtools both use HTSlib internally, but these source packages contain their own copies of htslib so they can be built independently.

Links:

115 questions
1
vote
1 answer

BWA can't find the local index file

I'm currently trying to import a .fasta file into bwa to use a reference genome to map my reads to. However, i currently am getting this error: [E::bwa_idx_load_from_disk] fail to locate the index files Any help? Here is my code:…
Haley
  • 119
  • 1
  • 3
  • 16
1
vote
2 answers

Detect large deletions from CIGAR string

I am new to sequence analysis and I'm doing some exercises to help me learn to use pysam and samtools for WGS data analysis. One thing I would like to do is to detect (rather large) deletions from 2D Oxford nanopore data (large reads). For this…
Sigurgeir
  • 365
  • 2
  • 12
1
vote
0 answers

An issue about pysam installation

It's linux, using conda to install pysam, and pip install pysam keep failing. After successful installed pysam, pysam shows in conda list and appears in anaconda2/pkgs/ but when import pysam in python 2.7.12, it failed by Traceback (most recent…
Lucas Lau
  • 27
  • 2
1
vote
2 answers

Is there a way to save an entire "alignment field/column" into a NumPy array using Samtools?

In the SAM format, each alignment line represents the linear alignment of a segment, and each line have 11 mandatory fields, i.e. QNAME, FLAG, RNAME, POS, MAPQ, etc. Let's say I wanted a NumPy array of all "QNAMES" in a given BAM file. Or, one…
ShanZhengYang
  • 16,511
  • 49
  • 132
  • 234
1
vote
0 answers

How to use htslib/samtools to transform SAM/BAM reads?

I'm using the htslib library for reading SAM/BAM files, it works perfectly. I can also write the alignments back to a new SAM/BAM file. For example, the following code prints the DNA sequence of an alignment: bam1_t *b = ...; int i; for…
ABCD
  • 7,914
  • 9
  • 54
  • 90
1
vote
1 answer

How to use pysam.view to emulate all functions of samtools view

I am trying to use pysam.view() to filter out certain alignments from a BAM file. The problem I am facing is how to include several regions in the filter. pysam.view() emulates the samtools view command which allows one to enter several regions…
Chaus
  • 11
  • 1
1
vote
0 answers

Error using DEXSeqDataSetFromHTSeq

Currently I am trying to understand DEXSeq package. I have a design tsv file and 7 files which contains Counts. Now would like to run the following command library("DEXSeq"); design=read.table("dexseq_design.tsv", header=TRUE, row.names=1); ecs =…
Jumaa Khan
  • 11
  • 3
1
vote
1 answer

How to compile and work samtools with cygwin

I need some help to resolve this problem. I got an error when I compiled Samtools under Cygwin (windows 8 64 bit). I got the following message: ADMIN@USER ~/samtools-0.1.19 $ make make[1]: Entering directory…
user3455175
  • 11
  • 1
  • 2
1
vote
1 answer

Multi-BAM visualization with Tablet alignment viewer

I have been using the Tablet alignment viewer (http://bioinf.scri.ac.uk/tablet/) to visualize my bam alignment files. Because I want to compare different individuals, I need to open 2 or 3 BAM together on the same window. But Tablet doesn't seem to…
kostas_bcn
  • 33
  • 5
1
vote
1 answer

How to install tophat in Debian?

I have tried searching and trying everything. I have bowtie, samtools and libbam-dev installed in my system. While running ./configure I am getting this error: checking for bamlib... configure: error: We could not detect the bam libraries (version …
New Folder
  • 97
  • 1
  • 2
  • 14
0
votes
2 answers

works on the command line but not in a shell script

I have this line samtools view -h file | awk '$3=="chr$a" || /^@/' | samtools view -S - -b -o output the dash between the -S and the -b is supposed to indicate to the program that it is from STDIN. I can run it from a perl script on the command…
user1234579
  • 179
  • 1
  • 1
  • 7
0
votes
1 answer

How to run a command on multiple files within subdirectories with similar file suffix?

I am still battling to understand and improve my command line skills. This time, I have a directory with 25 subdirectories. In each subdirectory, there are 4 sorted bam files which I want to index. I do not want to go to each subdirectory and…
user20330606
  • 105
  • 7
0
votes
0 answers

Extracting ITS Region from Paired-end FASTQ Data Using a Reference Genome: Guidance Needed

I have 20 isolates labeled as A_1 to A_50. For each isolate, I have paired-end FASTQ files. I also have a reference genome file available. I would like to extract the sequences of ITS (Internal Transcribed Spacer) region from each isolate using the…
kolom
  • 1
0
votes
0 answers

Pysam view yield reads one at a time

I'm trying to using pysam to filter a .bam file for mapping quality and excluding flags. I know I can use .fetch() and iterate through reads that way, but I'm guessing it's faster to first use pysam.view() However, when I try this on a large .bam,…
rbierman
  • 71
  • 3
0
votes
0 answers

Problem with viewing bam file downloaded from geo

I downloaded a dataset in the BAM Format from GEO using the command: prefetch SRR13558458 It generates a file names "SRR13558458.sra". I would like to view this file using samtools. But it seems this sra file which is a bam file is not readable…
Mahgen
  • 1
  • 1