Questions tagged [bam]

The "Binary Alignment Map" (BAM) format is one of the common binary formats used to store sequence alignment information. Questions should include this tag if they directly pertain to the format itself, details of BAM file usage, or errors relating to likely malformed BAM files.

Filter by
Sorted by
Tagged with
0
votes
1answer
23 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
43 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 ...
2
votes
1answer
23 views

How do I access sequence and MAPQ from bam using HTSlib in C++?

I am using the "htslib/sam.h" header in C++. I need to access the SEQ field of bam reads and store each sequence in a vector of strings. I also need to access the MAPQ field of each read to ...
0
votes
1answer
12 views

Impact of merging ChIP-seq runs of the same sample on PCR duplicates identification?

I'd like to a follow up question to this question related to merging fastq files for ChIP-seq. Let's assume we have one sample library that is re-sequenced two or three times in order to achieve a ...
3
votes
3answers
75 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++....
1
vote
1answer
52 views

How to convert CRAM file with 10x data in three fastq files

10x Genomics data are stored in three FASTQ files, besides the standard R1 and R2 reads, there is also a I1 file with some metadata. Sometimes however they are shipped in a single bam/cram file (e.g. ...
6
votes
1answer
61 views

Is there an efficient way to extract CIGAR strings for read pairs from bam files with python?

I am working with bam files and I have to check if reads of a specific position or their mates are soft clipped. So, I am looking for a fast way to extract the read pairs from a bam file in python. So ...
1
vote
1answer
30 views

Detecting SARS-CoV-2 variants from the mixed virus population

I have a fastq file from Nanopore sequencing data that contains reads from the UK and South Africa variants of SARS-CoV-2. These variants are identified by three key mutations in the receptor-binding ...
0
votes
1answer
37 views

RNA_Seq data aligned used uniquely or multi mapped reads impact on result interpretation

I have some transcriptomic (Whole) sequencing data that I should analyse. I would like to do raw data alignment to a reference genome taking into account the multi mapped reads and uniquely mapped ...
1
vote
1answer
61 views

What does presence/absence of black lines mean in IGV?

IGV (Integrated Genome Viewer) is a popular open-source tool for viewing alignment files. In my BAM file in IGV, some deletions have black lines running through them, and others don't. What causes ...
1
vote
1answer
80 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
1answer
65 views

How to check what software has been used to generate bam file?

I have several bam files from unknown origin. I'd like to know what software was used to obtain those bam files, e.g. bwa-mem. Is it possible to somehow check it?
1
vote
1answer
59 views

genotyping or variant calling in R

Are there any good options for calling variants or even just a pileup from R? R is not ideal for this, but I'd like to integrate with other functions. I found deepSNV::bam2R which roughly does what I ...
1
vote
0answers
38 views

Proper scatter/gather of bam files

I'm trying to do some calculus in parallel with BAM files. For that, I need to split the input bam file in chunks, process them in parallel and join them at the end. But I'm facing a read duplication ...
0
votes
1answer
55 views

extract chimeric and multimap reads from bam file

I am trying to extract all chimeric and multi-map reads from either SAM/BAM file. Is there any simple command to do that? Can I use htslib for parsing sam/bam files ...
1
vote
0answers
31 views

How to rename Read Groups

I periodically run into problems with Read Groups. I am in a desperate need for a tool that would allow me to fix them. This time, when I was mapping reads, I formatted all the information in the Read ...
1
vote
1answer
28 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: ...
2
votes
1answer
241 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 ...
0
votes
1answer
46 views

Nvidia Parabrick fq2bam pipeline error - No such file or directory

I am trying to implement Nvidia-parabrick fq2bam pipeline to process my WES dataset. The reason for opting this pipeline is the huge number of samples (1004) which take many months to process for ...
1
vote
1answer
97 views

Is there a straightforward way to get mismatches/indels in a BAM file using pysam?

Ideally, I'd like to do something like the following: ...
0
votes
1answer
63 views

Moving UMI from tag into read name

I have a bam file with Unique Molecular Identifiers (UMIs) for each read present on the RX tag ( such as RX:Z:TGAGAAGGG), as expected by picard and fgbio tools. ...
0
votes
1answer
21 views

Is it possible to convert BAM file from one genome assembly to the other?

I Have multiple BAM files that are referenced to UCSC genome assembly GRCh37/hg19 that are read in different time frames. Now, I am planning a different studies that require assembling all the data ...
0
votes
1answer
27 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: ...
0
votes
1answer
39 views

Get list of urls of GSM data set of a GSE set

I have this GSE dataset ( GSE104279 ) (https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE104279). I want to make a table with set IDs and ftp urls to use it as a table in galaxy.org I know that we ...
1
vote
1answer
119 views

Add tags to the read pairs in a bam file

I have a bam file from paired-end sequencing, in which each R1 has the RX tag assigned (via UMItools group) denoting a Unique ...
2
votes
1answer
20 views

Targeted hybrid capture bam files showing reads outside target regions in my bed file

Sorry if this is a stupid question I am new to analysing targeted hybrid capture data. I am analysing my HTS data from a targeted hybrid capture enrichment method and subsequent sequencing on a ...
0
votes
0answers
51 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
1k views

Error using htseq-count: Could not retrieve index file

I have a total RNAseq dataset that I aligned using STAR producing BAM files (sorted by coordinates). I am now trying to get counts for the lncRNA sequences using htseq-count, with the command: ...
1
vote
0answers
31 views

BAM file filteing to remain best isoform

I ran HiSat2, MarkDuplicate, removed reads with the lower quality score than 40 and finally only kept properly paired reads. After the BAM filtering steps, I used the Scallop results with TransDecoder....
3
votes
2answers
80 views

Sort reads in BAM file based on presence of specific deletion?

I have an indexed BAM file containing long-read sequencing data and I'd like to split the reads contained within into those with a known deletion and those without the deletion (I have the deletion ...
2
votes
2answers
108 views

Produce .vcf file of ALL mutations in .bam file

I got tasked with a problem, that i thought would be quite simple to solve, but turned out to be quite tricky. Our lab is running targeted mutagenesis experiments in yeast using crispr base editors. ...
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 ...
0
votes
1answer
68 views

How to anonymise a bam file

I have a bam file of, for instance, RNA-Seq, which contains patient-identifiable data in the form of Single Nucleotide Polymorphisms (SNPs) throughout. I would like a technique to take this aligned ...
1
vote
2answers
241 views

How to convert BAM file to bigWig in Python?

I am manipulating some BAM files using pysam package which seems to be very fast and handy. However, I ran into problem when I am trying to generate bigWig files ...
3
votes
1answer
135 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 ...
2
votes
1answer
31 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:...
3
votes
1answer
76 views

Chromosomal order of supplementary alignment in BAM file “SA” tag

I have several long-read sequences, which when aligned to a human reference genome, aligns to multiple chromosomal fragment as a result of chromothripsis shattering the linear DNA and randomly piecing ...
0
votes
2answers
266 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 ...
4
votes
2answers
1k 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 ...
1
vote
1answer
103 views

plot correlation between several bam files

I have several mab files from medip-seq. they supposed to be replicates and I have to draw their correlation. First I used multiBamSummary from deeptools to merge all the bam files based on bi/bed. ...
1
vote
2answers
439 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 ...
0
votes
1answer
56 views

HTSeq-count is returning 0 for every gene, instead of expression value

(Ported from stack overflow) I'm trying to summarize gene count using htseq-count; and it's returning 0 counts at every gene. I'm not sure what I'm doing wrong; I think it has to do with the gene ...
1
vote
1answer
370 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 ...
5
votes
1answer
462 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: ...
2
votes
3answers
91 views

Make a fasta out of mapped reads without taking into account the reference

I've aligned reads onto an haploid reference genome. I'd like to have a consensus sequence of all my aligned reads that doesn't take into account the reference genome I used (i.e. I just want the ...
1
vote
1answer
63 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
1answer
147 views

How to obtain file offsets corresponding to range query in block-gzipped file

How can we retrieve the file offsets of the zipped-chunks in a block-gzipped file that contain records for a region/window of interest (e.g. Chr01:100-Chr02:145)? It seems like the CLI of ...
3
votes
1answer
244 views

How to generate two fasta files from samtools phase output?

samtools phase is an easy-to-use tool to phase variants from a bam file and a reference. For a sequence that has two haplotypes, like this: ...
3
votes
1answer
66 views

Tool for calibrating base quality scores?

A given sequencing machine assigns a 'certainty' to each base call in the form of a per-base quality score (FASTQ format). I have reads from several machines aligned to the corresponding reference (...
3
votes
1answer
212 views

pysam or piping samtools view to a python script

Is it faster to use the PySam package to run a python script on a bam for read in samfile.fetch('chr1', 100, 120): print read compared to using a pipe and ...