Hot answers tagged

5 votes
Accepted

samtools view command not found error

Try re-indexing your bam file: samtools index input.bam Or update the timestamp via touch index.bam.bai but I think re-indexing ...
  • 3,577
4 votes
Accepted

How to convert a BAM file into a VCF file

To go from .bam to .vcf, it is fairly easy using bcftools call: ...
  • 1,290
3 votes
Accepted

Potential side effects of replacing read group tags in BAM file

You do not need to remap the files, replacing the read group information with samtools is sufficient to deal with this. When you update your pipeline, have it use ...
  • 19.3k
3 votes

Potential side effects of replacing read group tags in BAM file

I assume you are using GATK software tools for downstream analysis. If that's the case, then you will most likely encounter issues due to missing information on read groups. I believe that GATK can't ...
3 votes
Accepted

Reference variant detected as altered one in bam file

The ancestral allele is not always the reference allele. Ref and alt aren't switched, ref is just rare in at least the population you're looking at (it appears to be rare in humans as a whole). So, ...
  • 19.3k
3 votes
Accepted

Count reads at specific gene features

First of all, you need gene coordinates. You can retrieve them in GTF format from GENCODE or other sources. Next, extract TSS and TES +/- 2kb windows from each gene, taking in mind that genes can be ...
  • 136
3 votes
Accepted

Make mpileup file with several BAM files

Have you tried using samtools mpileup in.bam [in2.bam [...]]? Here's information about the output format from the manual page: The first three columns give the ...
  • 12k
2 votes

need bam file for pilon

Run a short-read mapper. For example: bwa index assembled.fasta bwa mem -pt16 assembled.fasta read1.fq.gz read2.fq.gz \ | samtools sort -m4G -@4 -o align.bam -
  • 6,023
2 votes
Accepted

Can I use samtools addreplacerg to replace multiple RG entries at the same time?

Not sure about samtools, but picard AddOrReplaceReadGroups can clear existing read groups and write a new one.
2 votes

BAM files with no RNAME and POS, how to map contents to SNPs?

These lines (with no REF or POS) are unmapped reads. If those lines are the entirety of the BAM file, then it is simply another file format to store the raw sequenced reads (as an alternative to FASTQ ...
  • 12k
2 votes

multi-sequence alignment of samples with multiple contigs each

MUMmer4 is a versatile alignment tool for DNA and protein sequences. It supports one reference genome and up to 32 query genomes. MUMmer4 will align every contig in each genome to the reference genome....
2 votes
Accepted

how to retain reads with low mapping quality (MAPQ) scores when using samtools view -q

Looking at the samtools view docs, I believe that you need to also set the -p flag if you want to retain "filtered" reads in the file and simply have them ...
1 vote
Accepted

Aligning scRNA-seq fastq to .bam without cell barcodes

The linked dataset is based on the Smart-seq2 technology. This is a plate-based assay in which individual cells are first sorted into individual wells of a microwell plate via FACS. The cells are then ...
1 vote

Get number of reads with a single, (almost) exact match to the full length of a reference sequence

Because minimap2 is a minimiser-based mapper, it's less useful for determining mapping accuracy to single-base precision. Where precision matters, you can use LAST, bearing in mind that it calculates ...
  • 12k
1 vote

multi-sequence alignment of samples with multiple contigs each

If you have a reference genome (or are willing to designate one of your de novo assemblies a reference), you may find QUAST helpful. QUAST will perform an alignment of all genomes against the ...
1 vote

multi-sequence alignment of samples with multiple contigs each

It won't work on more than 3 genomes at a time, but SynMap3D from the Comparative Genomics webserver (https://genomevolution.org/coge/) should do the trick. I'm mentioning it here because the ...
  • 657
1 vote
Accepted

Filtering paired-end reads with sambamba: avoid discarding reads on the minus strand

The reason is that sambamba does not use the absolute value of the template length, so, if the read maps so the minus strand, the template length is actually ...
  • 131
1 vote

Detect mutation context in a read of a sam file

If you want to look at a few, specific reads manually, you can do this on VarSome. We have recently released a new feature that allows you to enter single NGS or Sanger reads and get the list of ...
  • 8,235
1 vote

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

You'll want to use the 10x provided bamtofastq tool to preserve the indices properly: https://github.com/10XGenomics/bamtofastq
1 vote

Accessing .bam/.cram files from AWS S3?

I have recently open sourced a Java NIO SPI for S3 that allows direct reads from S3 using Java applications that use the NIO model. This allows applications like GATK and some parts of Picard to ...
  • 121

Only top scored, non community-wiki answers of a minimum length are eligible