Questions tagged [samtools]

Questions specific to interacting with and post-processing sequence alignments using the SAMtools package. For questions specifically about formats SAM, BAM or CRAM use tags sam or bam,

Filter by
Sorted by
Tagged with
2
votes
0answers
23 views

How to analyze IGV alignment

I'm working on a project where I am analyzing the performance of an alignment workflow. My goal is to find regions in the resulting BAM file where there are outstanding discrepancies or anything that ...
4
votes
1answer
156 views

Is there a tool that can perform a read-group-aware mpileup from a single file?

I would like to perform a samtools mpileup from a single file that contains thousands of read groups with different SM tags. I could split the bam by read group ...
7
votes
7answers
6k views

How to subset a BAM by a list of QNAMEs?

I have a text file 'qnames.txt' with QNAMEs in the following format: EXAMPLE:QNAME1 EXAMPLE:QNAME2 EXAMPLE:QNAME3 EXAMPLE:QNAME4 EXAMPLE:QNAME5 I would like to ...
1
vote
1answer
38 views

Is there a sam flag for all&none of the reads?

a. Is there a SAM flag that specifies all reads? b. Is there a SAM flag that specifies none of the reads? So that if I run samtools view -f (a) -F (b) the result will be all reads of the file (as if ...
0
votes
1answer
36 views

Convert VCF file to mpileup.txt

I am working on an iterative analysis that uses orthologous pipelines that require mpileup.txt files as input for a visualization step. This requires me to convert VCF files to mpileup.txt. This ...
3
votes
1answer
446 views

How to get a MSA fasta from BAM/SAM?

I am working with paired end NGS miseq data from a viral genome with multiple timepoints. I have filtered and trimmed this data for quality and adapter sequences. I have then merged the filtered ...
1
vote
2answers
39 views

How to extract all sequences mapped to a transcript from Kallisto output

I ran Kallisto with the --pseudobam option. How do I extract all the short reads that are mapped to a single transcript (e.g. ENST00000367969.8)? As a person without any previous SAM/BAM experience, ...
2
votes
1answer
246 views

Cuffmerge: EOF marker is absent. The input is probably truncated

I need to merge my all transcripts.gtf from cufflinks output follow this command line : cuffmerge -o merged_gtf_output -p 15 -s ref.fasta -g anot.gtf assembly.txt ...
3
votes
5answers
4k views

How to create a .bed file from .fasta? [duplicate]

I have some problems in creating a .bed file for hg19, so I will be able to visualize the .bed file in IGV. The .fasta file contains rows of this form: ...
2
votes
1answer
29 views

Counting the co-occurrence of variants A and B in an aligned sequencing read

I need some help getting started on this project. To simplify we want to be able to quantify the occurrence of 3 variants on each sequencing read in an alignment file as a proxy measurement for ...
4
votes
1answer
209 views

Displaying soft-clipped nucleotides in samtools tview

There are nicer genomics visualization tools available, but the samtools tview command is almost always my go-to for a quick first look at read alignments. I just ...
1
vote
1answer
69 views

How to convert multiple single-end bam files to fastq using samtools

Hi I am trying to convert bam files generated from Ion Torrent Proton sequencing to fastq format so that I can upload them to ...
0
votes
1answer
41 views

Is it normal to have a smaller bam file after merging bam files?

I have 2 bam files that belong to the same sample and I merged them with samtools merge. And after merging, I realized that the merged version is a bit smaller than ...
1
vote
2answers
65 views

Can HTSlib extract bam reads occurring in a specific region without iterating through the whole file?

I am using htslib/sam.h to write a C++ program. As part of this program, I must extract reads occurring on specific scaffolds in specific regions from a bam file. Essentially, I want to perform the ...
11
votes
3answers
6k views

Converting a VCF into a FASTA given a reference with Python, R

I am interested in converting a VCF file into a FASTA file given a reference sequence with Python or R. Samtools/BCFtools (Heng Li) provides a Perl script ...
3
votes
3answers
83 views

Unable to open .bam file in C++ using SeqAn due to 'seqan::UnknownExtensionError'

I am trying to open .bam files in C++ to extract reads occurring at specific scaffolds and loci. I essentially want to call "samtools view sample.bam -o sample.sam scaffold:pos-pos" from C++....
5
votes
1answer
157 views

Samtools/bcftools calling indels in noisy reads

I have very noisy nanopore reads and am trying to call SNPs/indels. I'm runinig into some trouble when truing to use the samtools mpileup | bcftools call ...
1
vote
0answers
59 views

Conversion of SAM to BAM files

I am very new to micro RNA analysis. I have been using H. sapiens, GRCh38 + major index as given in the Bowtie Website to align with my trimmed FASTQ file . The command I am using to make very ...
2
votes
1answer
26 views

Python package or CLI tool outputting mutations of sequence with respect to reference

I'm new to bioinformatics, and I'm looking for a tool that takes two FASTA files, one containing a reference, let's call it A.fasta, the other another sequence, let'...
4
votes
0answers
137 views

convert supplementary reads to primary in sam or bam

I have a problem with a tool, that possibly ignores supplementary reads. I want to find out a bit how this tool works by converting all supplementary reads to primary reads, and then change the names ...
0
votes
0answers
43 views

seqff script got trouble after samtools treatment

I'm trying to study fetal fraction by using a seqff script from here. The instruction says that I need a headless sam file to work so after alignment with bwa, I process my sam file by using samtools: ...
1
vote
1answer
177 views

Inflate operation failed: progress temporarily not possible, or in() / out() returned an error

I download a BAM file from ftp-trace.ncbi.nlm.nih.gov:/giab/ftp/data/NA12878/10Xgenomics_ChromiumGenome_LongRanger2.0_06202016/NA12878_GRCh38.bam (171G), and I am trying to view the comparison result ...
3
votes
2answers
3k views

Error while calling bcftools mpileup - Failed to open -: unknown file type

I have sequenced a bacterial genome with a GridIon from ONT. Basically what I want to check is whether or not trimming 50 bps at the beginning of the reads will improve alignment against the reference ...
3
votes
1answer
1k views

Running htseq-count over BAM files

I am trying to derive an expression matrix from BAM files using htseq-count. These are bulk RNASeq BAM's by the way. I have read the ...
0
votes
1answer
40 views

How can I run the latest version of samtools on Slurm?

I am trying to run the following script on slurm to extract information from .sam files. While everything is perfect on my local machine with the samtools version 1.11, it does not work on slurm. I ...
0
votes
1answer
83 views

How to perform bowtie2 analysis with slurm?

I am trying to run my alignment script that works locally, using SBATCH. Official manual for bowtie2 says I can use ...
1
vote
1answer
210 views

How can I extract information from .sam files?

I have 10 .sam files after my bowtie2 alignment on ten single-pair sequences. I would like to build a graph based on that output ...
1
vote
1answer
41 views

How to extract reads with INDELs > a given size?

I'm trying to modify this https://www.biostars.org/p/253774/ To get reads with deletions > 20bp I think this gives reads with exactly 20bp dels: ...
1
vote
1answer
458 views

What is "unmapped read segments" in the output of samtools idxstats?

samtools idxstats produces a four column output (see here) ...
2
votes
1answer
464 views

How to generate a consensus sequence from a multi-reference BAM file?

I am trying to generate a consensus sequence from a BAM file that was generated by mapping reads to a reference FASTA containing multiple sequences. Usually, I generate consensus sequences from BAM ...
3
votes
2answers
260 views

Frequency of specific viral sequence in .BAM or .fastq

I was wondering if anyone had any experience 'counting' the frequency of a particular viral sequence in an individual's fastq sequence. So basically, counting the number of occurrences of a particular ...
0
votes
1answer
123 views

Reading fasta sequence regions with faidx

Im coding in c++ and reading in different reference genomes to examine regions across the chromosomes a few hundred basepairs at a time. To do it in c++ i use the library htslib and the command ...
0
votes
1answer
29 views

How to identify to each scaffold a read belongs to, inside a .sam file?

I have a fasta file assembly and combining it with the raw reads we produced a .bam file which I converted to .sam . The .sam information lines look like this: ...
1
vote
2answers
262 views

Trying to create a .bam file without the need for a .sam file

I'm trying to use the code specified in this link to create a .bam file without the need for a .sam file. Here is the code I'm using: ...
1
vote
1answer
65 views

samtools / bamUtil | Meaning of <wildcard> as Reference Name

I have been working with several tools on bam files recently and I am not sure how I should interpret some of the outputs. samtools idxstats mapped.sorted.bam <...
1
vote
2answers
139 views

Mapping statistics from bam file using bbtools and sambamba

Below are the statistics for RNA-seq mapped and unmapped paired-end reads to rice genome using reformat.sh from bbtools on bam files. It gives 77% mapped and 5% unmapped, what about the remaining 18% ...
0
votes
0answers
61 views

summarising read group information from a .bam file

I have merged together 2 different .bam files in order to simulate sample contamination. So the reads can come from one of two samples, as shown by the read group info: ...
0
votes
1answer
290 views

NO_COOR reads not in a single block at the end 0 -1

I am doing an RNA seq analysis with mouse samples. I had my reads in several lanes, so I concatenated those fastq reads. Then I've mapped my reads with Hisat2 against the new version of mouse "...
0
votes
1answer
144 views

How to convert a Pileup file to VCF format with Hg19 alignment

I would like to know how to convert a pileup file for an adna y chromosome to vcf with Hg19 alignment.
0
votes
1answer
56 views

Obtaining HGDP project data in fasta format

I need to obtain sample data from modern humans in fasta format. I just need some megabytes of data from every individual. I actually use a script that obtains the cram file from here (ftp.1000genomes....
2
votes
1answer
74 views

Why does samtools mpileup sometimes include ref bases (other than ',' or '.')?

This is my first post here. I can think of no way of giving an easily reproducible example, as per the stack ethos. SO apologies in advance and any feedback on question format appreciated. I have ...
0
votes
2answers
48 views

Basic question about finding mRNA sequence in transcriptome

I am a computer scientist just starting out in bioinformatics topics, and would appreciate any guidance that can be given here: I have an mRNA sequence- an isoform - whose length is about 4000 base ...
1
vote
1answer
2k views

Samtools Index: Chromosome Blocks not Continuous

I am working with short-read whole-genome sequences from the NCBI's SRA. I have aligned and sorted all of my short-read sequences and am attempting to index each sequence into .bai format using ...
4
votes
1answer
385 views

Error given while trying to index a BAM file with Samtools Index - NO COOR?

I am currently working on my own Metagenomic pipeline, utilizing Bowtie 2 to map. Bowtie 2 outputs a SAM file, which I convert to a .BAM and sort it using Samtools. When I try to utilize Samtools to ...
2
votes
1answer
286 views

How to extract unmatched reads using bwa and samtools?

I have a single read (NOT paired) that I need to pass through the workflow described in Beauclair et al. paper (free version here https://rnajournal.cshlp.org/content/24/10/1285.long) for identifying ...
1
vote
1answer
73 views

How can I get unmatched reads for defective genomes analysis using bwa and samtools?

I am trying to follow the Beauclair et al. paper (free version here https://rnajournal.cshlp.org/content/24/10/1285.long) for identifying defective genomes using their DI-tector program. According to ...
2
votes
4answers
137 views

How to make work programs from the $PATH?

I am trying to analyze my RNAseq reads for defective genomes and I use this program (http://www.di-tector.cyame.eu/) that is suggested by Beauclair et al (https://pubmed.ncbi.nlm.nih.gov/30012569/) ...
0
votes
2answers
324 views

Accessing .bam/.cram files from AWS S3?

What's the best/easiest way for accessing .bam/.cram files from S3? I have .bam/.bai .cram/.crai and .bed + .gff files that I want to make available easily to others so they can browse in IGV and ...
1
vote
2answers
573 views

Marking optical or PCR duplicates with picard vs. samtools flagstat

I am trying to identify the best library prep method for noninvasive prenatal test samples, to be sequenced with Illumina Novaseq. One metric that I am evaluating is the number/ percentage of PCR or ...
2
votes
1answer
33 views

Phasing problem using "samtools phase"

so I'm having a problem using samtools phase. I'm trying to phase my .bam archives that where generated by aligning my samples with my reference genome. Following the documentation I tried the command:...