4 votes

Get a certain gene sequence from bam/vcf and reference

The first approach that comes to mind is to cut the bam file and then convert the already cut bam to fasta: ...
terdon's user avatar
  • 9,846
4 votes

Problem with samtools command with a final hyphen

The hyphen "-" character is commonly used as a placeholder in Unix commands to represent the standard input (stdin) or standard output (stdout) streams. From the POSIX specification: ...
Steve's user avatar
  • 3,079
4 votes
Accepted

Problem with samtools command with a final hyphen

It allows you to chain commands together to avoid creating intermediate files and simplify your workflow: Samtools is designed to work on a stream. It regards an input file `-' as the standard input (...
user438383's user avatar
  • 1,679
3 votes
Accepted

Nextflow Error: failed to read header from "-"

This is not a Nextflow error. The problem is that without an input file, samtools sort tries to read from stdin. Using a recent ...
Steve's user avatar
  • 3,079
2 votes

How to filter a SAM file by a bed file?

You can also do this with bedtools intersect: bedtools intersect -abam input.bam -b bedfile.bed > output.bam This should be ...
bricoletc's user avatar
  • 161
2 votes

Extracting all reads from bam file which match read IDs in another file

samtools can do this natively too using -N, --qname-file CLI option: ...
bricoletc's user avatar
  • 161
2 votes
Accepted

How to subsample BAM based on read line number?

Samtools+awk: ...
user172818's user avatar
  • 6,525
2 votes

I am trying to create a subset of 10k variants from 25-30 unmapped contigs of a g.vcf file including the header

After some guidance from my advisor, this command allowed me to get the output file I needed. ...
Lauren Sabo's user avatar
2 votes

regex: samtools command to "refine" PacBio IsoSeq data?

The samtools view command you've provided just uses a filter expression to discard records that do not meet the specified expression criteria. In this case, the ...
Steve's user avatar
  • 3,079
1 vote

Discrepancy in Depth of Coverage Estimation between Pileup and samtools depth

This is purely a guess based on what you write given that you are not showing the exact command for samtools etc. I suspect that you are allowing sequences with MAPQ==0 (supplementary alignments) into ...
Maximilian Press's user avatar
1 vote
Accepted

low mapping percentage in bwa mem

Just answering, following extensive back and forth in the comments. I think that your reads are fine: FASTQC doesn't see anything too weird. You see some noise at the first few basecalls but I am not ...
Maximilian Press's user avatar
1 vote
Accepted

Create bam from separate sam and header

I'd use GNU parallel. I've not tested this with real files but try it out, ensure the {} is passed to the process substitution: ...
Ram RS's user avatar
  • 2,279

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