Questions tagged [samtools]

Samtools is a suite of programs for interacting with high-throughput sequencing data.

Samtools is a suite of programs for interacting with high-throughput sequencing data. It consists of three separate repositories:

  1. Samtools Reading/writing/editing/indexing/viewing SAM/BAM/CRAM format
  2. Reading/writing BCF2/VCF/gVCF files and calling/filtering/summarising SNP and short indel sequence variants
  3. HTSlib A C library for reading/writing high-throughput sequencing data Samtools and BCFtools both use HTSlib internally, but these source packages contain their own copies of htslib so they can be built independently.

Links:

115 questions
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
0 answers

seqff script got trouble after samtools treatment

I'm trying to study fetal fraction by using a seqff script from here. The instruction says that I need a headless sam file to work so after alignment with bwa, I process my sam file by using samtools: samtools view -S -q 20 target.sam >…
0
votes
1 answer

I'm new to Linux and I'm trying to activate "module load python2 samtools rseqc" but I'm running into Lmod version issues

I keep receiving this error; ERROR: rseqc/3.0.0 requires several additional modules. Run the following commands to load all of the dependencies (including this module): But when I try to load in python3 I get this error; Lmod has detected the…
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
0 answers

MarkDuplicates Picard

I am using Picard to mark only optical duplicates for which I read the manual of MarkDuplicates. My script looks like this #!/usr/bin/bash java -jar build/libs/picard.jar MarkDuplicates \ I=sorted.bam \ O=mark_opticalduplicate.bam \ …
Bandana
  • 21
  • 1
  • 6
0
votes
2 answers

Problem of running samtools in python using subprocess.run()

I'm using subprocesss.run() to run samtools command in python. The code is as below: result = subprocess.run(['samtools', 'faidx', 'hg38.fa.gz', 'chr1:169699712-169699719'], check=True, stdout = subprocess.PIPE) and I got the following…
Aragaki
  • 41
  • 1
  • 3
0
votes
1 answer

How to pipe samtools mileup with varscan trio caller?

I have seen piping samtools with varscan as follows samtools mpileup -f reference.fasta sample1.bam sample2.bam | java -jar VarScan.jar mpileup2snp But how to pipe the following pipeline for varscan trio #Generate a three-sample mpileup samtools…
user2110417
0
votes
1 answer

Extract reverse BLAST matches with samtools faidx

I am using samtools faidx to extract the sequences matching the ranges given by a BLAST output file (format is tabular -outfmt 6). Unfortunately, there are BLAST matches forward and reverse. The forward ranges are processed without problems by…
0
votes
1 answer

How to most efficiently retrieve data from NarrowPeak (BED6+4) format files?

I am working on a bioinformatics project that involves very big NarrowPeak formated files that look like this: (the columns are 'chrom ,chromStart, chromEnd, name, score ,strand, signalValue ,pValue, qValue ,peak') chr1 713835 714424 chr1.1 …
egg33
  • 99
  • 5
0
votes
0 answers

executing samtools in terminal: "command not found", but it is installed

I have samtools installed, and I have used it before on my computer. I am trying to get it to work now, but when I type in samtools in terminal (mac os), it returns "command not found". I have navigated into my samtools folder too and it is still…
Emily
  • 23
  • 5
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
1 answer

How to add "OQ" tag with read quality score as additional field in the bam file using pysam

I need to add read quality with OQ tag as an additional field to the bam file using pysam. Other conventional ways using samtools etc consume more time and create multiple files. I tried with the given below script but end up unsigned character…
0
votes
0 answers

unmapped reads using bwa

i'm trying to use BWA MEM to align some WGS files, but i notice something strange. When I used samtools flagstat to check these .bam files, I notice that most reads were unmapped. 76124692 + 0 in total (QC-passed reads + QC-failed reads) 308 + 0…
0
votes
1 answer

SAM (Sequence Alignment/Map) Format Alignment Tags

I am using samtools to remove duplicates. To mark and then remove duplicates markdup relies on ms (mate score) and MC (mate cigar) tags that fixmates provides. Does anyone knows exactly what are these tags? How is fixmates doing? Thanks for the…
0
votes
0 answers

Run simultaneous tasks followed by single task in one slurm script

I need a Slurm script to do the following: Create a directory in scratch space for temporary storage (requested using sbatch --gres disk:1024) Run samtools sort on hundreds of bam files and store sorted copies in scratch space (as many at once as…
jaegger
  • 58
  • 1
  • 6