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
1
vote
1 answer

Looking up and extracting a line from a big file matching the lines of another big file

I permitted myself to create a new question as some parameters changed dramatically compared to my first question in my bash script optimising (Optimising my script which lookups into a big compressed file) In short : I want to lookup, and extract…
H. Vilbert
  • 119
  • 6
1
vote
1 answer

converting multiple BAM files to BED files

I have BAM files in the external hard drive. Want to convert them into BED. Am using cd /media/amit/LaCie/mdc_work/chigozie/pool1/bam for x in *.bam ; do echo "print current:$x"; bedtools bamToBed -i "$x" > "${x%.bam}.bed"; done echo…
1
vote
2 answers

Add tag to bioperl DB::SAM/BAM

I have a bam file and use bioperl (Bio::DB::Sam) to work with it. Now i wanted to ask if there is any possibility to add tags to alignments in this File? i use my $iterator = $bam->features(-iterator => 1, …
I3ilbo
  • 11
  • 1
1
vote
1 answer

How to write rules for software with version specific shell calls? (E.g. Samtools 1.3.1 and 0.1.18)

Thoughts on how to account for a pipeline which can use versions of a software which requires a (slightly) different shell call? At times, switching between versions with conda, the shell calls are different, E.g. Samtools 0.1.18 and Samtools 1.3.1.…
TBoyarski
  • 441
  • 3
  • 9
1
vote
2 answers

Is there a way to save an entire "alignment field/column" into a NumPy array using Samtools?

In the SAM format, each alignment line represents the linear alignment of a segment, and each line have 11 mandatory fields, i.e. QNAME, FLAG, RNAME, POS, MAPQ, etc. Let's say I wanted a NumPy array of all "QNAMES" in a given BAM file. Or, one…
ShanZhengYang
  • 16,511
  • 49
  • 132
  • 234
1
vote
0 answers

How to use htslib/samtools to transform SAM/BAM reads?

I'm using the htslib library for reading SAM/BAM files, it works perfectly. I can also write the alignments back to a new SAM/BAM file. For example, the following code prints the DNA sequence of an alignment: bam1_t *b = ...; int i; for…
ABCD
  • 7,914
  • 9
  • 54
  • 90
1
vote
2 answers

Subset SAM/BAM file in R

I have a BAM file with lots of reads. I can load it into R with scanBam from Rsamtools. However, I only need a subset of reads. I have a character vector with the qnames I am interested in. scanBam returns a list with 1 element which is a list with…
mschilli
  • 1,884
  • 1
  • 26
  • 56
1
vote
0 answers

SeqAn C++ library : different rID values for bam vs. sam with identical data, bam results in assertion failure due to length of namestore

I'm using seqan 1.4.1 to read sam/bam files. I have a sam and bam file from the same data (an alignment to rn5 refseq genes). Oddly enough I didn't get this error when I aligned to ensembl genes. I am reading the sam/bam files BamStream, but the…
daj
  • 6,962
  • 9
  • 45
  • 79
0
votes
1 answer

Statistically comparing two surfaces (gams)

I have been struggling with comparing two surfaces provided by a tensor product (by factor) from my gam model. To keep it simple, let's say the important part of the model looks like that: y~te(a,b,by=factor)+covariate) The model also includes…
0
votes
0 answers

Problem with viewing bam file downloaded from geo

I downloaded a dataset in the BAM Format from GEO using the command: prefetch SRR13558458 It generates a file names "SRR13558458.sra". I would like to view this file using samtools. But it seems this sra file which is a bam file is not readable…
Mahgen
  • 1
  • 1
0
votes
0 answers

BaseRecalibration by GATK

Does someone know why the size of bam file after using BaseRecalibrator becomes twice larger? I am using GATK_4.1.9. Thanks!
Anna
  • 53
  • 6
0
votes
0 answers

extract mappep reads from sam to classify them

I want to extract mapped reads from a SAM file (from a resistome analysis using AMR++) to taxonomically classify them. I was searching from samtools manual and stackoverflow mainly and found these steps samtools view -@ 20 -S -b…
0
votes
1 answer

pilon error, file .bam must be indexed BAM

I have an error to do this: After Flye assembly I obtain the file assembly_DG_1.fasta The I used: bwa index assembly_DG_1.fasta bwa mem -pt16 assembly_DG_1.fasta DG_1_R1_001_val_1.fq.gz DG_1_R2_001_val_2.fq.gz | samtools sort -m4G -@4 -o align.bam…
Giffredo
  • 79
  • 2
  • 8
0
votes
0 answers

CRISPR genome wide screen analysis using MAGeCK-- Loss of reads/sgRNA using MAGeCK count function?

I am trying to run the MAGeCK pipeline to analyze CRISPR knockout screen data produced by someone in my lab around 5 years ago. I was given the data as BAM files and also have the sequencing sample statistics from when the samples were run including…
0
votes
0 answers

Installing pysam for HTSeq - "PackagesNotFoundError: The following packages are not available from current channels:"

I am new to Python, Anaconda, and coding in general. I'm trying to install pysam. I need it to install HTSeq so that I can convert bam files to count files for a class project. Once they are count files, I plan to use edgeR for the rest of the data…
Emily
  • 1
  • 1