Skip to main content

Questions tagged [sam]

Use this tag for questions specifically related to the text SAM format. For general questions about the SAM/BAM formats use the tag BAM.

Filter by
Sorted by
Tagged with
1 vote
1 answer
61 views

How to subset BAM file based on read length range (120-180) bp?

Hi I'm wondering how I can subset a BAM file based on read length. Precisely I want just read lengths of 120 to 180 bp reads in the new BAM file. I'm trying several way, but none of them giving the ...
19 votes
2 answers
14k views

Obtaining uniquely mapped reads from BWA mem alignment

This is based on a question from betsy.s.collins on BioStars. The original post can be found here. Does anyone have any suggestions for other tags or filtering steps on BWA-generated BAM files that ...
1 vote
1 answer
28 views

Problem while mapping reads to mtDNA (SortSam)

I am trying to map MiSeq reads to a reference genome and extract mutations using MToolBox, which implements gsnap, GATK, Picard, and other tools. When running the tool with example data, there were no ...
3 votes
1 answer
117 views

How to reduce BAM

Consider a sorted, indexed, only mapped reads containing BAM file. Is there a way to get a sub BAM based on read line numbers? This can be done iteratively using a counter but its too slow. Is there a ...
8 votes
2 answers
3k views

Convert BAM to properly paired FASTQ files

I thought I had figured this one out. But apparently not. I need to convert a BAM file of paired-end alignments to two FASTQ files of paired reads to realign them, with a twist: I only want reads that ...
2 votes
1 answer
314 views

calculate mismatch frequency/rate from a BAM file

I am working with PAR-CLIP data where experimental procedure induces T to C mismatches. The other types of mismatches we can consider coming from artifact such as PCR errors. It could also be an ...
1 vote
0 answers
29 views

Large skip after aligning using Cellranger

I have a read from BAM file as following ...
1 vote
1 answer
39 views

Pysam - fetch reads within region

I'm using pysam (and also samtools) to find all reads in BAM files that are within a specific region py_bamfile.fetch('4',42266768,42268410) and the following read ...
7 votes
1 answer
494 views

samtools mpileup empty when filtering out flags

I produced a bam file by aligning reads to a small set of synthetic sequences using bwa-mem. I am heavily filtering reads that are not paired and of a certain orientation. Applying the filtering, I ...
1 vote
2 answers
80 views

Discrepancy in Read Counts Between FastQ and BAM Files in Adapter-Trimmed Pipeline

In a FastQ to BAM pipeline where only adapter trimming is performed, I've noticed a potential discrepancy in read counts between the initial FastQ files and their resulting BAM file. Specifically, I'm ...
2 votes
1 answer
2k views

How do you normalise read coverage in a BAM file?

This is a question from the Oxford Nanopore community, from user Michael Radzieta: I have sequenced some plasmids using the rapid barcoding kit, I have attempted to assemble the data using several ...
7 votes
1 answer
3k views

Index a BAM file using pysam

(How) can you index a BAM file using pysam? When I tried the intuitive pysam.index I got: ...
0 votes
0 answers
57 views

Generate simulated bam for certain snps

I want to benchmark my DNA sequencing pipeline. In order to do that I want some gold-standard files in every step(.vcf,.bam,.fastq). I want to generate/simulate a bam file of reads for a given set of ...
20 votes
4 answers
15k views

How can I downsample a BAM file while keeping both reads in pairs?

I know how to downsample a BAM file to lower coverage. I know I can randomly select lines in SAM, but this procedure can't guarantee two reads in a pair are always sampled the same time. Is there a ...
3 votes
1 answer
193 views

low mapping percentage in bwa mem

After aligning paired-end reads to a reference genome, I am getting low percentage: ...
1 vote
2 answers
824 views

Extract end position from CIGAR

I was wondering how could I obtain the end position of an alignment using its start position and its CIGAR String. If an alignment present some soft clipping, for example: ...
-1 votes
1 answer
107 views

Gviz Coverage Plots

This question has also been asked on Biostars I have two bam files from single-cell RNA sequencing mapped to the reference genome using CellRanger, I can view them in IGV and I have a particular ...
1 vote
1 answer
164 views

obtaining a fragment data file bed from bam

Im trying to follow this pipeline https://github.com/epifluidlab/cragr on cfDNA WGS. I have bam files from paired end reads aligned with bwa mem. The workflow requires bgzipped and indexed fragment ...
1 vote
0 answers
77 views

STACKS ref_map.pl no BAM records

I have 133 aligned and sorted BAM files that I am trying to run through the ref_map.pl script from the STACKS pipeline. My script looks as follows: ...
1 vote
1 answer
52 views

Check mutation of a gene

Hi all, I am checking if a gene which around 50k base pairs has mutation. So is that a variant from A to G? Would you please tell me how to do so? Thank you so much! The reference sequence from GRCh38,...
5 votes
2 answers
3k views

BAM to gene expression matrix (UMI counts per gene per cell),10X

I am trying to reproduce some results of a scRNASeq experiment. However I am new to the server-side aspect of such analyses and am very confused at the moment. The data provided by the authors of the ...
2 votes
2 answers
127 views

Chromosome information for miRNA

Apologies if this question is previously asked. I have a BAM file alignment to hg19 and miRNA gff3 file from ...
2 votes
0 answers
27 views

Off-target % for whole-exome sequencing panel

My samples have been sequenced with the Twist Exome 2.0 sequencing panel, and I want to assess how efficient the sequencing has been. By efficient, I mean examining metrics such as the uniformity (...
15 votes
5 answers
2k views

Good / recommended way to archive fastq and bam files?

We have a lot of Illumina sequenced exome data. Currently we are using spring for its great lossless compression, but we are looking if there is anything better (and most preferably opensource) which ...
2 votes
2 answers
4k views

How to filter a SAM file by a bed file?

I have a large BAM file and I want to filter it by just what's defined in a bed file, and write it to a new file. Is it possible to do this with samtools, and if so, how? Is there a better tool I ...
0 votes
0 answers
52 views

How to export the list of soft-clipped regions from a region of interest in IGV

I want to export the list of soft-clipped regions into a csv file from a region of interest in IGV. Additional information regarding the soft-clipped sequence, coordinate and nucleotide length will be ...
1 vote
1 answer
61 views

Can bwameth accept unaligned Bam?

Does bwameth accept bam (unaligned) type as input or I will have to convert unaligned bam to fastq (samtools fastq bam) to use ...
1 vote
1 answer
351 views

In CellRanger output, what are the reads with an xf:i:17 tag?

When running CellRanger on 10x scRNA-Seq data, a BAM file is output with the aligned reads. These reads have an xf tag, described here: The bits of this tag are ...
16 votes
2 answers
10k views

Merge hundreds of small BAM files into a single BAM file

I am working with over a million (long) reads, and aligning them to a large genome. I am considering running my alignment jobs in parallel, distributing horizontally across hundreds of nodes rather ...
2 votes
1 answer
114 views

Dealing With Manta Limitations

I am trying to figure out a way to remove the limiting factors that Manta says it cannot handle. To quote from the Manta page: The following limitations exist on the input BAM or CRAM files provided ...
4 votes
2 answers
6k views

Extracting all reads from bam file which match read IDs in another file

I have a long list of read IDs of interest to me in a file called read_names.txt. it is simply in the format: ...
1 vote
1 answer
515 views

Estimate insert size for single-end data with picard CollectInsertSizeMetrics

I have a BAM file generated from single-end data and I want to estimate the insert size using picard's CollectInsertSizeMetrics as follows: ...
4 votes
4 answers
183 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++....
2 votes
1 answer
124 views

need bam file for pilon

I just ran an assembly on yeast genomes using Flye and I want to polish those assemblies with Pilon but it requires a sorted BAM file. How do I make a BAM file of the resulting assembled.fasta?
0 votes
0 answers
106 views

Help sought with GWAS and vcf files, lack phenotype labels

This question has also been asked on Biostars Hi, I am very new to this area, and I am taking a class about bioinformatics. For an independent project assignment, I need to do a GWAS. I am using the ...
6 votes
4 answers
1k views

multi-sequence alignment of samples with multiple contigs each

I want to perform a multi-sequence alignment on 12 samples that clustered based on cgMLST. Ultimate goal is to find out whether they differ by the presence of a few genes. I have performed multi-...
9 votes
2 answers
789 views

How to import a large amount of .bed, .gff, .vcf, .paf, .sam files into an SQL database?

Are there best practices to load different bioinformatics file formats such as VCF, BED, GFF, and SAM to SQL databases? I am wondering how people out there do that efficiently. All of these three ...
5 votes
2 answers
3k views

How can I easily get the read size distribution of reads mapping on a certain set of regions?

Suppose I have a BAM file indicating where reads in a library have mapped, and a bed file describing a set of genomic regions. Is there a way to easily get the size distribution of the reads mapping ...
1 vote
2 answers
142 views

Filter bam with sambamba

I have a very large bam file and I want to filter it to keep only a handfull of positions as defined in a bed file. Can I do this with sambamba or do i need another tool? Thanks
1 vote
1 answer
436 views

VCF or BAM file for raw data of gene test?

My friend has a VUS (Polymicrogyria with or without VEDS) mutation that was found in her whole-exome sequencing with respect to the phenotype given that time. At present, her doctors have more ...
6 votes
1 answer
726 views

Why do SAM and BAM use different coordinate systems?

BAM files are, at least as far as I know, simply binary compressed versions of SAM files. They have the exact same information and are used in the same way. Why then does the SAM format use a 1-based ...
3 votes
2 answers
315 views

What can be the bias of aligning paired-reads in a single-end mode?

I don't know if I'm in the right place but I have a technical problem to fix. I would have to align paired-end reads from Illumina sequencing to compare a normal genome with a tumor one. When I align ...
0 votes
1 answer
282 views

Make mpileup file with several BAM files

I'm new to this business, so my question may seem as dumb. I want to make an mpileup file using a reference sequence and several (two to begin with) aligned sorted BAM files. And I want the output ...
8 votes
3 answers
4k views

How to merge sam files together with adding read groups

I have three sequencing libraries of single individual mapped to a reference using bwa-mem. I would like to merge the three unsorted ...
41 votes
4 answers
61k views

What is the difference between FASTA, FASTQ, and SAM file formats?

I'd like to learn the differences between 3 common formats such as FASTA, FASTQ and SAM. How they are different? Are there any benefits of using one over another? Based on Wikipedia pages, I can't ...
7 votes
4 answers
5k views

Is there a command line tool to split a SAM/BAM file by CB (cell barcode) tag?

I have a BAM file from a single cell sequencing experiment. Each read has had the cell barcode annotated in the CB tag. Some reads do not have a ...
2 votes
1 answer
164 views

Count reads at specific gene features

I have BAM files from an RNA-Seq experiment and for all genes (or a subset) I want to get the number of reads in regions around the TSS (e.g. 2kbp) and the TES (e.g. 2 kbp) and calculate the ratio ...
2 votes
1 answer
933 views

how to retain reads with low mapping quality (MAPQ) scores when using samtools view -q

I have been using the -q option of samtools view to filter out reads whose mapping quality (MAPQ) scores are below a given ...
1 vote
1 answer
200 views

Aligning scRNA-seq fastq to .bam without cell barcodes

I would like to convert the fastq files from this dataset: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE98679 to .bam files. The group did not provide the scripts they used to to their ...
2 votes
1 answer
213 views

Get number of reads with a single, (almost) exact match to the full length of a reference sequence

I can't find an answer to this in previous questions, so hoping someone can help me now. We have nanopore sequenced a PCR product, and I've filtered our reads to +/- 10 bp of the expected product ...

1
2 3 4 5