Questions tagged [bam]

The "Binary Alignment Map" (BAM) format is one of the common binary formats used to store DNA/RNA 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. Also includes Sequence Alignment/Map (SAM) format, which is a human-readable version of BAM format.

SEE ALSO:
Sequence Alignment/Map Format Specification
BAM
SAM

52 questions
4
votes
2 answers

Infer the length of a sequence using the CIGAR

To give you a bit of context: I am trying to convert a sam file to bam samtools view -bT reference.fasta sequences.sam > sequences.bam which exits with the following error [E::sam_parse1] CIGAR and query sequence are of different…
j91
  • 451
  • 1
  • 4
  • 14
2
votes
2 answers

Split a SAM file in Awk keeping N number of lines as header

I have a very big Sequence Alignment Map (SAM) file as depicted below @X YYYYYY ZZZZZ\ @X ssssss ddddd\ @X CCCCCC LLLLL > FFFFFF 117 ch1 16448 0 * = 16448 0 …
Somu
  • 25
  • 3
2
votes
3 answers

sum elements in python list if match condition

I have a variable with lists with varied number of elements: ['20', 'M', '10', 'M', '1', 'D', '14', 'M', '106', 'M'] ['124', 'M', '19', 'M', '7', 'M'] ['19', 'M', '131', 'M'] ['3', 'M', '19', 'M', '128', 'M'] ['12', 'M', '138', 'M'] Variable is…
fonpe
  • 23
  • 2
2
votes
0 answers

Different results with MACS2 when Peakcalling with .bed or .bam

I got the following problem: I use MACS2 (2.1.0.20140616) with the following short commandline: macs2 callpeak -t file.bam -f bam -g 650000000 -n Test -B --nomodel -q 0.01 It seems to work as I want, but when I convert the .bamfile into .bed via…
N. F.
  • 21
  • 1
1
vote
1 answer

Bio::DB::Sam - Get number of mappings for all reads in bam file

I want to calculate transcript expressions and therefore I need to get the number of mappings for all reads in the bam file. My current procedure is to go overall transcripts and get the reads that mapped on it using Bio::DB::Sam. The results are…
Matthias Munz
  • 3,583
  • 4
  • 30
  • 47
1
vote
0 answers

bam-readcount: command not found

(https://i.stack.imgur.com/FvbBp.png) I tried installing readcount for BAM files from (https://github.com/genome/bam-readcount) by retracting the latest release version from Docker with docker pull mgibio/bam-readcount git clone…
age_gs
  • 11
  • 3
1
vote
0 answers

Error using BWA to map environmental transcriptome against a genomic reference

I have quality controlled paired end environmental transcriptomic data that I want to map against a reference database of 8 cyanobacterial genomes. I made this reference by joining together the fasta files of each genome. I performed this mapping…
1
vote
1 answer

MissingOutputException snakemake

I am getting an MissingOutputException from my snakemake workflow, snakemake creates the required output in the desired directory but keeps looking for it and exits. this is my snakefile. rule all: input: …
1
vote
1 answer

What is the best way to use expand() with one unknown variable in Snakemake?

I am currently using Snakemake for a bioinformatics project. Given a human reference genome (hg19) and a bam file, I want to be able to specify that there will be multiple output files with the same name but different extensions. Here is my…
James
  • 13
  • 2
1
vote
1 answer

Find sequencing reads with insertions longer than number

I'm trying to isolate, from a bam file, those sequencing reads that have insertions longer than number (let's say 50bp). I guess I can do that using the cigar but I don't know any easy way to parse it and keep only the reads that I want. This is…
PaulaO
  • 67
  • 3
1
vote
3 answers

Bash: Extract reads from BAM files based on read length

my first question on stack overflow and I hope you can help me. Suppose a BAM file, from which I only want to extract the reads of a certain length (42 - 65 nt; column 10), but with the information of the remaining columns. Exemplary…
XSmitt
  • 29
  • 6
1
vote
1 answer

How to retain reads on only an certain size in a bam file?

I have certain bam files which have reads of different size. I wish to create another bam file from it which has reads smaller than a certain length N. I should be able to run samtools stats and idxstats like commands on it. Is there a way to do it?
1
vote
0 answers

Different estimates between bam and gam model (mgcv) and interaction term estimates edf of 0

I am new to fitting gamm models and ran into two problems with my analysis. I ran the same model using the gam and the bam function of the package mgcv. The models give me different estimates, and I don't understand why and how to choose which…
Luca
  • 43
  • 4
1
vote
0 answers

Converting BAM files to FASTQ using Google Colab

I am trying to convert BAM files from Ion Amplicon sequencing to FASTQ files. I am using Google Collaboratory. I will be using the FASTQ files in R for the pipeline DADA2. Any help would be greatly appreciated.
Nicole_B
  • 11
  • 2
1
vote
1 answer

Error trying to predict without random effect from bam() output

I have a data set I am trying to fit with bam() in the mgcv package. The model has a binary outcome and I need to specify random intercepts for each animal ID. A subset of the data is below (my actual data is much larger with many more…
Silas Bergen
  • 21
  • 1
  • 4
1
2 3 4