Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 298

Questions specific to interacting with and post-processing sequence alignments using the SAMtools package. For questions specifically about formats SAM, BAM or CRAM use tags sam or bam,

1 vote

How to extract all sequences mapped to a transcript from Kallisto output

Alternatively, you could also just convert the bam to sam and then look for lines where the 3rd field (the reference the sequence is aligned to) is what you want: samtools view pseudoalignments.bam | awk …
terdon's user avatar
  • 10.6k
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: samtools view -hb chr1:10100500-10200500 > small.bam samtools fasta small.bam > small.fa (note … that I am not certain about the samtools fasta command, I have never used it and I don't know if it will produce many sequences, one for each haplotype supported by reads; please test this.) …
terdon's user avatar
  • 10.6k
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 varia …
terdon's user avatar
  • 10.6k
3 votes

Running bwa mem and samtools in one script on a linux cluster

So you would want a loop like this (I removed the unnecessary samtools view step, since samtools sort can handle the sam to bam conversion, and the also unnecessary -r option; if you know you need the … sample_name=${file%_1*} file2=${file/_1/_2} mkdir -p "$outBamsDir"/"$sample_name" bwa mem \ -t 14 \ /path/to/contig/contigs.fasta \ "$file" "$file2" | samtools
terdon's user avatar
  • 10.6k
1 vote
Accepted

How to reverse complement the DNA sequences for given inverse/reverse coordinates?

The exonerate tool comes with some very handy utilities for sequence manipulation. Here, we are interested in fastasubseq and fasterevcomp. First, install exonerate as described here. If you're using …
terdon's user avatar
  • 10.6k
5 votes
Accepted

Aligning FASTQs to FASTA reference

samtools view -bS $STUDY-data.sam > $STUDY-data.bam This simply converts the SAM file to a BAM file. Essentially a compressed SAM. … samtools view -b -f 12 -F 256 $STUDY-data.bam > $STUDY-data-no-human.bam Here, you are filtering your bam. …
terdon's user avatar
  • 10.6k
1 vote

Error while calling bcftools mpileup - Failed to open -: unknown file type

The - is usually used to mean standard input when reading data. So the message would suggest that the second bcftools command fails to read from stdin, so it fails to read the output of the first bcft …
terdon's user avatar
  • 10.6k