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
0
votes
0 answers

Obtain fraction of gene covered from bam file using bed file

I am trying to calculate the gene coverage of specific genes in a BAM file. I have a list of genes with thier start and end positions in a BED file. I would essentially like to know the number of overlaps for each gene and how well it is covered. My…
0
votes
1 answer

Sort vec of structs by custom (natural?) order of String field and numeric field

I am looking for suggestions on how to sort a vector of structs based on a custom order for a String field (unknown at compile time). If the strings are equal, then a numeric value is used for further sorting. (The application is sorting by…
Wouter De Coster
  • 409
  • 3
  • 17
0
votes
1 answer

convert CRAM file to SAM file

I have a 50GB *.CRAM file and I need to convert it into *.SAM file My reference genome is hg38 and I got this CRAM from Nebula genomics How can I do it?
Guy Ab
  • 3
  • 2
0
votes
1 answer

calculate size each exon from Cigar string in a bam file

I have a bam file i want to calculate size for each exon: for example i have 6 cigar…
0
votes
0 answers

Bam file processing function code with parseargs in Python and Ubuntu

I am trying to adapt a piece of code to extract information for specific elements in bam files. Here is what I have so far: import pysam import pandas as pd import argparse args = [] def parseargs(required_args=True): class…
Laura
  • 13
  • 4
0
votes
0 answers

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 nucleotides each read has in these two positions. So my…
wennj
  • 1
  • 1
0
votes
0 answers

Why is a specific row of 'samtools view' broken after grep?

I want to extract readname list one of which is uniquely mapped and the other is multi-mapped. However, after some try&error, I found the 1st raw of samtools view -@ 6 XXX.sorted.bam | if grep -q XS:i: ; then awk '{print $0}' ;else:;fi | head is…
kofuji
  • 1
  • 1
0
votes
2 answers

How to use pysam.view() to convert SAM to BAM

I would like to convert my SAM file to a BAM using pysam library. I am trying to write this command from samtools: samtools view -S -b sample.sam > sample.bam as a python code like this: pysam.view("-S", "-b", "sample.sam", ">",…
twinsinc
  • 123
  • 2
  • 11
0
votes
1 answer

Multiple outputs to single list input - merging BAM files in Nextflow

I am attempting to merge x number of bam files produced via performing multiple alignments at once (on batches of y number of fastq files) into one single bam file in Nextflow. So far I have the following when performing the alignment and…
0
votes
1 answer

Running multiple snakemake rules

I would like to run multiple rules one after another using snakemake. However, when I run this script, the bam_list rule appears before samtools_markdup rule, and gives me an error that it cannot find input files, which are obviously have not been…
user3224522
  • 1,119
  • 8
  • 19
0
votes
1 answer

Command lines in snakemake

I want to create a list of BAM files in the folder using this command line: ls *.bam > bam_list But, I would like to integrate this in snakemake. How to do this? This is what I tried, but is not working: rule bam_list: input: inlist…
user3224522
  • 1,119
  • 8
  • 19
0
votes
1 answer

How do I download BAM Files from SRA? I have the SRA Toolkit but I'm confused

I'm trying to download a dataset in the BAM Format from GEO/SRA, that I can use for analysis in RStudio. I tried using this method: where i downloaded .sra and converted it to .bam prefetch GSM269238 sam-dump…
ww22an
  • 41
  • 2
  • 6
0
votes
0 answers

BWA: Detecting Variation in Short-Read Sequences

I used the Burrows-Wheeler Aligner to map a high-coverage short-read sequence to a reference genome. The output is in .sam format. I have also used a separate program to identify the loci in the reference genome at which microsatellites occur. I…
0
votes
0 answers

Error inputting string into a pandas dataframe?

I'm trying to create a dataframe using outputs from the pysam module which is used on genomic data (Bam/Sam files). Pysam.depth() outputs a table as a string. I have used the module StringIO to try to parse the string into a pandas dataframe,…
0
votes
1 answer

Running DeepVariant on GRCh38 Whole Exome Sequence

I'm trying to run DeepVariant on my BAM file to produce a VCF. I have the following questions: 1 - The alignment is in GRCh38, which model should I use. Can I use the standard whole exome sequence model?…