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
0answers
22 views

pysam "Exec format" error

I am a beginner and trying to read a bam file in Python. The lines below throw the error ...
6
votes
1answer
201 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 ...
0
votes
0answers
31 views

Fastest way to count where two bam files are homozygote reference (inverted variant calling)

Maybe I'm having a brain-freeze so excuse me if this is a waste of everyone's time... I am working with an organism with ~700Mb genome. I have bam files of two individuals that are whole genome ...
1
vote
2answers
31 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, ...
1
vote
0answers
60 views

Extract read names and the associated nucleotides on specific positions from a BAM file (in R)

Let's assume I have a BAM file and several positions that I would like to examine more closely in this alignment. My goal is to find out whether these positions are on the same reads and which ...
1
vote
1answer
44 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
0answers
53 views

Splitting .bam files into separate samples for tophat2

I have RNA seq data of 12 samples (paired end, so 24 files) and I ran tophat2 for alignment on all of them which gave me one bam file for all the samples. Now I need separate bam files for all the ...
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 ...
0
votes
1answer
37 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
59 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
28 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
14 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
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++....
1
vote
1answer
85 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
129 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
36 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
43 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
81 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
142 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
69 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
77 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
42 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
103 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
37 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
36 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
391 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
52 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
146 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
71 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
23 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
51 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
180 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
21 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
57 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
82 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
137 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
75 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 ...
2
votes
2answers
263 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
143 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
32 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
95 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
308 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
123 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
542 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
66 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 ...